你好,游客 登录 注册 搜索
背景:
阅读新闻

Angular2升级到Angular4

[日期:2017-03-29] 来源:luamas.com  作者:luamas [字体:大 中 小]

Angular4终于在两天前发布了正式版本,那么怎么升级呢?其实Angular2和Angular4之间属于平滑过渡,并不像1和2之间颠覆性的重写代码。

Angular4现已发布  http://www.linuxidc.com/Linux/2017-03/142268.htm

  1. 使用npm-check方案升级 使用如下命令检查,并按下空格来选择要升级的包
    npm-check -u
    
  2. 官方推荐
    1. 升级cli
     npm uninstall -g @angular/cli
     npm cache clean
     npm install -g @angular/cli@latest
    
     rm -rf node_modules dist # use rmdir /S/Q node_modules dist in Windows Command Prompt; use rm -r -fo node_modules,dist in Windows PowerShell
     npm install --save-dev @angular/cli@latest
    
    1. 升级包
     // linux/mac
     npm install @angular/{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router,animations}@latest typescript@latest --save
     // Windows
     npm install @angular/common@latest @angular/compiler@latest @angular/compiler-cli@latest @angular/core@latest @angular/forms@latest @angular/http@latest @angular/platform-browser@latest @angular/platform-browser-dynamic@latest @angular/platform-server@latest @angular/router@latest @angular/animations@latest typescript@latest --save
    
    1. 更换一些其他包
     npm install zone.js@0.8.4 --save
    
    1. 执行安装命令
     npm install
    

一些AngularJS相关文章链接:

AngularJS权威教程 清晰PDF版  http://www.linuxidc.com/Linux/2015-01/111429.htm

希望你喜欢,并分享我的工作~带你走近AngularJS系列:

  1. 带你走近AngularJS - 基本功能介绍 http://www.linuxidc.com/Linux/2014-05/102140.htm
  2. 带你走近AngularJS - 体验指令实例 http://www.linuxidc.com/Linux/2014-05/102141.htm
  3. 带你走近AngularJS - 创建自定义指令 http://www.linuxidc.com/Linux/2014-05/102142.htm

如何在 AngularJS 中对控制器进行单元测试 http://www.linuxidc.com/Linux/2013-12/94166.htm

在 AngularJS 应用中通过 JSON 文件来设置状态 http://www.linuxidc.com/Linux/2014-07/104083.htm

AngularJS入门之动画  http://www.linuxidc.com/Linux/2017-01/139198.htm

AngularJS 之 Factory vs Service vs Provider http://www.linuxidc.com/Linux/2014-05/101475.htm

AngularJS —— 使用 ngResource、RESTful APIs 和 Spring MVC 框架提交数据 http://www.linuxidc.com/Linux/2014-07/104402.htm

AngularJS 的详细介绍:请点这里
AngularJS 的下载地址:请点这里

本文永久更新链接地址:http://www.linuxidc.com/Linux/2017-03/142315.htm

linux
相关资讯       Angular4  Angular2升级到Angular4 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款