Angular 2.0 Core by Igor Minar & Tobias Bosch at ng-europe 2014
Why Stack Overflow recommends it
Stack Overflow users link it when answering questions about whether to start on Angular 1.x, whether $scope and controllers will survive, and how to prepare code for the move to 2.0.
Recommended by 7 people across 6 different months, 2014 to 2015.
What it is
A 30-minute conference talk from ng-europe 2014 in which Igor Minar and Tobias Bosch of the Angular team introduce the planned core of Angular 2.0 by comparing it with Angular 1.3. It covers what is being dropped, such as controllers and $scope, and why the framework is being rewritten.
What people said
Recommends Davin Tryon · 2014-10 · Stack Overflow · on “I'm thinking of starting a Angular project.. should I wait for version 2?”
As I understand there is no 1.3 -> 2.0 upgrade path planned by the Angular developers. So, no 1.3 is not going to be upgradable. Version 2.0 is not likely to ship until late next year (late 2015, or beyond). Therefore, if you want to do a project in the next year, it will have to be 1.3. It looks like 2.0 will be a major departure from 1.3. For example, there will not be $scope or controller !! So, 2.0 is a re-write not really another version. The video from ng-europe [this video] explains how different 2.0 is planned to be.
Recommends Wayne Ellery · 2014-12 · Stack Overflow · on “Learning/implementing AngularJS before the upcoming 2.0 release”
2.0 won't be out till late next year. I'd recommend watching this video: [this video] I wouldn't take much from that "Hello World" example. The thing that you have to realise is that web browser technologies are changing at a rapid rate and frameworks such as Angular need to change with them. As a web developer you learn to learn new tech all the time. I would encourage you to learn how to keep learning new frameworks and technologies.
Recommends divyenduz · 2015-01 · Stack Overflow · on “Angular 2: Is usage of Parentheses / Square brackets mandatory?”
It's not mandatory - see here [LINK] . Please checkout the directives section (near the middle of the page): the "Decorator Directive" is still there, which means with regards to your question. There will be a fall back way for sure. Do checkout the official demonstration [this video] as well: ng-model / click are used in that as well.
Recommends thank_you · 2015-01 · Stack Overflow · on “AngularJs "controller as" syntax - clarification?”
From what I've read, $scope will be removed in Angular 2.0, or at least how we view the use of $scope. It might be good to start using controller as as the release of 2.0 nears. Video link here [this video] for more discussion on it.
Recommends Radim Köhler · 2015-02 · Stack Overflow · on “ui-router with customer controller and ng-strict-di”
That is bit of a joke ;) check some blogs/videos ... angular 2.0 will not have controllers, no modules, no scope... but that is far from now ;) YOU SHOULD observe this one for sure: [this video] ;)
Recommends celsomtrindade · 2015-06 · Stack Overflow · on “AngularJS reuse multiple controllers to build a webapp”
Ok. I'll try to work with what you said. Note: About the controller stuff, i saw it in here: [this video] in case you want to check it.
Recommends qwelyt · 2015-07 · Stack Overflow · on “value not getting updated in the controller”
As it has been indicated that $scope will go bye bye in the future (you can have a read at this "preparing for the future of angularjs" on airpair [LINK] , also a link the the youtube video of the ng-europe talk [this video] ), and you might want to write your code for easy upgrading to 2.x So, unless you absolutely need $scope for something, try this: index.html <body ng-controller="MainCtrl as vm"> <p>Hello {{vm.name}}!</p> <div> <form class="form-horizontal" role="form"> <input data-ng-model ="vm.name" data-ng-change="vm.checkValue(vm.name)" class="form-control" required/> </form> </div> </body> app.js app.controller('MainCtrl', function() { vm = this; vm.name = "world"; vm.checkValue = checkV
Cites artur grzesiak · 2015-01 · Stack Overflow · on “AngularJS: Should I convert directive's linking function to a controller?”
UPDATE (at the bottom I added a code/plnkr that shows the approach) Apart from the article you mentioned: [LINK] , which basically not only advocates the pattern you are asking for, but component based front-end in general, I have found: [LINK] (it advocates Minimal use of the link function and use ui-bootstrap as an example where such a pattern has been used). I cannot agree more with both these articles. Another thing about Angular2.0: no more $scope in angular2.0 -- [this video] , so surely if you can get rid of $scope as much as possible, then the transition should be smoother. I made a small mistake as well: Still, I prefer to define all functions in controller and just call them via link 's
Cites Andrew Clark · 2015-03 · Stack Overflow · on “Prevent controller from creating new scope object”
We create our controllers and wrap them in factories to make them accessible. We apply or controllers through directives (also going away). This gives you a controller that is scoped to the directive, which has better control for scope, this works for us as the directives where we do this for are usually components. I don't know if this will be an option given the road you are down now. I would suggest trying to stop using ng-controller. You may want to look at angular 2 now just to keep it in mind as a migration path, it is coming in the fairly near future. They have removed ng-controller, a lot of what they are doing in angular 2 can be done now. This is a good resource on why these things