Getting ready for 2.0
FrontMen
Before at ING, Malmberg
Maybe a bit slow
2 way binding as default
Like:
http://webcomponents.org/
https://github.com/lukehoban/es6features
Start thinking in components
Start using ES6/ES2015/Typescript
<div ng-controller="gmailController"> A lot of html </div>
<div ng-controller="gmailController"> <div ng-controller="searchController">...</div> <div ng-controller="foldersController">...</div> <div ng-controller="messagesController">...</div> </div>
Already way better
Smaller controllers, no more Angular $scope,
better understandable viewmodel, use of this
inside our controllers.
But still..
No reusability, no clear relation view and controller,
still possible to use $parent and mutate or access parent data.
http://www.johnpapa.net/angularjss-controller-as-and-the-vm-variable/
<gmail-app>
<search-component/>
<folders-component/>
<messages-component/>
</gmail-app>
{ restrict: 'E', controller: 'GmailController', controllerAs: 'gmailCtrl', bindToController: true, scope: true, templateUrl: 'templates/gmail.html' }
http://teropa.info/blog/2014/10/24/how-ive-improved-my-angular-apps-by-banning-ng-controller.html
<gmail-app>
<search-component on-search="gmailCtrl.search()/>
<folders-component active-folder="gmailCtrl.activeFolder"/>
<messages-component messages="gmailCtrl.messages"/>
</div>
Bindings and values (input) (=/@)
<messages data="someCtrl.messages" limit="10"/>
Event methods (output) (&)
<message-window on-send="someCtrl.someMethod()"/>
For package management. Uses registries like npm and github.
jspm install github:angular/bower-angular
For module loading (ES6 style), transpiling, bundling etc.
Also plugins!
System.import('./app'); import angular from 'angular;
http://jspm.io/
https://github.com/systemjs/systemjs
See you around afterwards...
Code is at: https://github.com/bobbijvoet/es6-angular