最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Migration path for AngularJS 1.2 - Stack Overflow

programmeradmin1浏览0评论

I have written an application using AngularJS 1.0.7. I would like to migrate to AngularJS 1.2. What is the migration path (what issues might I need to fix when migrating)?

I have written an application using AngularJS 1.0.7. I would like to migrate to AngularJS 1.2. What is the migration path (what issues might I need to fix when migrating)?

Share Improve this question edited Nov 1, 2013 at 22:38 XML 19.5k9 gold badges66 silver badges67 bronze badges asked Aug 19, 2013 at 9:11 poiuytrezpoiuytrez 22.5k35 gold badges123 silver badges184 bronze badges 2
  • You mean AngularJS 1.2.0? And what does the migration path mean? URL? – Sanghyun Lee Commented Aug 19, 2013 at 9:19
  • Right, version 1.2.0. Migration path means what should I do to be able to migrate my project to 1.2 (which part of code could be broken, etc.) – poiuytrez Commented Aug 19, 2013 at 9:30
Add a comment  | 

3 Answers 3

Reset to default 10

The angular team has put together a very comprehensive 1.x to 2.0 migration guide here: http://docs.angularjs.org/guide/migration

Exceptions logged in the console have also been greatly improved. They now include a link to an error reference manual with a detailed explanation of the exception and how to correct it. You can find the error manual here: http://docs.angularjs.org/error

There is no official guide to migrate from 1.0.7 to 1.2 but the best thing I can find is the changelog through angularJS's versions: https://github.com/angular/angular.js/blob/master/CHANGELOG.md .

They notice the crucial changes that can break in the new version so you can look into that.

The biggest change you probably need to deal with is on routing: there is now a separate module to handle routing, just as angular-resource was already separate. You'll need to load the separate angular-route.js file and declare ngRoute as a dependency when you create your app. Until you do that, your app will likely be broken. But that was the only major obstacle I faced. (I've heard we should expect this trend to continue, as they break Angular down into smaller, more modular chunks, so people can take what they need, and skip what they don't.)

Beyond that, there are wholesale new features like the Animations module, a bunch of new directives, and some nice new docs. But I'm not yet aware of anything else you'll need to 'migrate', unless you had already implemented some of the new features on the 1.1.x branch. (FWIW, I've collected some additional detail on this stuff on my blog.)

发布评论

评论列表(0)

  1. 暂无评论