November 29, 2014
How not to die moving from Angular 1.x to 2 + ES6 @ ngToronto Meetup
How not to die moving from Angular 1.x to 2 with Nick and Yuri from Rangle.io
-
J2EE, Rails, Python, ActionScript all had unpredictable, large shifts over the years. This is no surprise!
-
Angular may change, but plain js is a good starting place for future browser technologies
-
Soul of angular is DRY, structure, testability, which are portable concepts
-
Angular 2 is a 3 year plan. They early announcement prevents us from being blindsided by change, but it is freaking people out. The alternative to no change is standardize and stick with IE6 like banks did for many years
-
Good news: lots of discussions on design of Angular 2 are online and public, so anyone can catch up on how and why things are changing
-
Look for Nick’s matrix outlining changes in scope, controllers, DI, messaging.
Easy ways to prepare, best practices for today.
-
Nested scope? No Says Yuri! Avoid. Use
controller as
syntax -
Always put directives in isolated scope
-
Put as much stuff in services as possible, because services are modules with DI. Then could swap Angular’s DI with something else in the future. See Rangle’s Nebular project
Harder ways to prepare
-
Use more plain js (no dependencies other than a browser environment) and export objects as modules to use inside of Angular 1.x services
-
Yuri is thinking about running components of a large app in an iframe to sandbox, see multi-framework-app on Github. Each iframe can run a different version of Angular, or another framework entirely. iframes can communicate with each other over a simple API so they can all be integrated together
ES6 with Matias Niemelä
-
Ever notice frameworks and libraries often duplicate core bits of functionality? That is a cry for better language features
-
How many hacks do we have for modules, templating, looping over stuff? Underscore, lodash, polyfills, handlebars
-
Here’s an example of a more complex Angular 1.x app where ES6 could be useful