我不是在寻求什么意见--只是一个可靠的迁移策略。
我们开始设计一个新的项目,指定与我们以前的每一个角度建造,这个项目的重要性非常高,它将生存和维护至少3-4年。
Range2.0将于2015年底面世,看起来一切都将发生变化,$scope已经退出,指令也将退出,整个DI的概念也将发生变化。
发布于 2015-04-24 14:58:53
发布于 2015-08-29 09:46:36
最新的博客文章,从今天的角度发展,将给你一个很好的一步一步的过程。关键是使用新的ng升级库。以下是直接从博客文章中获得的步骤(下面有链接):
- Edit an Angular 1 directive's template to conform to Angular 2 syntax
- Convert the directive's controller/linking function into Angular 2 syntax/semantics
- Use ng-upgrade to export the directive (now a Component) as an Angular 1 component (this is needed if you wish to call the new Angular 2 component from an Angular 1 template)
- a. Most services should require minimal to no change.
- b. Configure the service in Angular 2
- c. (optionally) re-export the service into Angular 1 using ng-upgrade if it's still used by other parts of your Angular 1 code.
角1和角2共存
祝好运!
https://stackoverflow.com/questions/27441268
复制相似问题