Back to the ng2 Future
- 2. About iVision
A privately held, IT consulting firm headquartered in Midtown, Atlanta.
At iVision, we seek to understand our clients’ business first. We work with clients to
architect, transform and support their technology — enabling them to realize their
vision of a better tomorrow.
Jeremy Likness| Director of App Dev
https://github.com/JeremyLikness
http://bit.ly/coderblog
The iVision Difference
Engineering Expertise
White Glove Service
Delivery Assurance
Flexible Business Model
Proven Partner Ecosystem
Culture & People
About iVision
- 3. Today’s Menu
• Angular 1.x
• $scope
• Controller as
• Components
• Angular 2.x
• TypeScript
• ngForward
• ngUpgrade
• Q & A
- 5. TypeScript
• All JavaScript *is* TypeScript
• Learn how to declare module definitions
• Use a module loader
• Convert to classes
• Add annotations
• Consider the Angular-CLI (http://bit.ly/ngclidocs)
- 11. Steps
• JavaScript
• Remove ng-app or Angular 1 bootstrap code
• Include Angular 2 libraries, including the upgrade library
• Bootstrap with the upgrade adapter
• Begin migrating components and services
• Finally, remove Angular 1 and upgrade references and run directly
• TypeScript
• Organize into TypeScript files
• Configure compiler workflow
• Choose module loader
- 12. Caveats (There always are some, no?)
• 1.5 Components
• Elements
• Isolated Scope
• Bind to controller, not $scope
• Own controller and templates
• Not Compatible:
• compile
• replace: true
• priority/terminal (ignored)
• Angular 2 use Angular 2
binding syntax even when
downgraded
• For Angular 1 templates, use
kebab-case not camelCase!
• Project ng1 into ng2 with
ng-content in template
• Transclude ng2 into ng1
with ng-transclude in
template
- 13. Quick Note on Services
• upgradeNg1Provider(‘name’)
• addProvider(type)
• downgradeNg2Provider(type)