Several developers asked me about how difficult it will be to migrate Angular 1 to Angular 2. Angular 2 isn't done, so I legitimately have no idea how hard it will be. But there are a few high-level guiding principals in the design of Angular 1 that make adapting to changes like this fairly painless.
Angular 1 was designed so it would have a fairly minimal API surface. Let's look at controllers, since these are the meat of your app. Controllers are just functions that get passed other components as arguments:
MyController ($scope) {
$scope.list = [];
$scope.addItem = function (name) {
$scope.list.push({
name: name
done: false
});
};
}
The way you integrate this into Angular app is to register it with a module:
angular.module('myModule', []).controller('MyController', MyController);
But you could also call the function MyController
yourself, then hook up events:
var scope = {};
MyController(scope);
someDom.addEventListener('click', function () {
scope.addItem(myForm.value);
renderList(); // defined elsewhere
});
Even though Angular 2 will probably not have an angular.module
API, it should be easy to adapt much of your code to the new API.
Some frameworks rely on inheriting from specific classes for their models. If you subclass these framework-provided classes, your classes will break whenever the API of the superclass changes. This is a technique that Angular specifically avoids. In Angular, you can use POJOs as models, or you can build up your own classes. Either way, changes in Angular itself will not affect your model's code.
Angular has other such features that reduce needless coupling, but these are just two examples.
I am little bit concerned with html, controllers, directives and scope too but I think you cant progress without pain. Just decide if you would want a framework hacked his way around to the top of its potential in 5 years or completely rewritten itself to a point much better than that in a much shorter time. It seems to me that modifying a product this way is not a decision of a business analyst it is a decision of a developer and a well taken one considering ES6. I would do the same if i were them. Good thing is there will be no dept in my code after all this is over. ;)