Simple script to migrate from Angular1.* to Angular2.0

Angular team is still working on this script, but Todd Motto has already provided us first version. It’s really simple:

var ngMigrate = (function () {

var v2uri = ‘’;

return function (version) {
var v1 = document.querySelector(‘script[src*=angular]’);
if (!v1) return;
var body = document.body;
var script = document.createElement(‘script’);
script.async = script.src = v2uri;



Here you can play with the code.

And one more brilliant idea from Todd – here – tool to define which type of service you should use (service, factory or provided). You can safely provide this link to you colleagues if somebody asks you to help with this question.