II. Precautions: Non-Medical
- Not for Medical Care
- The author uses several software packages and programming languages to develop FPnotebook content
- For convenience, a dozen pages in FPNotebook are dedicated to quick notes on content creation
III. Technique: Angular 2 New Project
- Use a starter project
- Angular-2 CLI (command line interface)
- Angular quickstart
- IDE Setup
- See VS Code (includes TS tasks, snippets)
- Further setup from the command prompt
IV. Technique: Debugging in Chrome
- Add the Augury plug-in (previously Batarang)
- Allows visualization and navigation of angular components within Google Chrome
- Chrome developer tools
- Find the id of the object of interest in the UI Elements window (e.g. $0)
- Typing the identifier (e.g. $0) in the console window will return the object and allow for drilling down
- Modify the contents of the object using ng.probe($0).componentInstance.PROPERTY = NEW_VALUE
- Changes will take effect with ng.probe($0)._debugInfo._view.changeDetectorRef.detectChanges()
- Other debugging tools
- debugger;
- Place within code, and a break will occur at this point
- If tsconfig.json is set to use "sourceMap: true", then debugger will display the source typescript code
- Json pipe: {{item | json}}
- Outputs the model item to the UI in readable json format
- Logging
- Consider npm installing the angular2-logger
- debugger;
- References
V. Technique: Angular-Bootstrap (old for angular 1)
- Website
- Preparation
- Use Angular 1.2.x versions (as of 4/26/2015)
- Angular-Bootstrap is the Bower package to install
- Add the ui-bootstrap-tpls.min.js file to the index.html
- Follow instructions for CSS modifications
- Follow instructions for adding "ui.bootstrap" to the angular module dependencies
- Restoring bootstrap.js functionality
- Navbar button functionality (collapsed and menu dropdowns)
- http://stackoverflow.com/questions/14741988/twitter-boostrap-navbar-with-angular-js-collapse-not-functioning#23918553
- Toggle button changes
- Remove data-toggle and data-target from the toggle button
- Add ng-init="isCollapsed" and ng-click="isCollapsed=!isCollapsed" to the toggle button
- Change the collapsed div to ng-class={collapse: isCollapsed}
- Dropdown buttons
- Add ng-class={open:ddBtn} ng-init="ddBtn=false" ng-click="ddBtn=!ddBtn"
- Navbar button functionality (collapsed and menu dropdowns)