How to upgrade from Angular 4.2.4 to Angular 4.3

情到浓时终转凉″ 提交于 2019-12-03 22:47:19

I think you should be fine. Once you reference the new packages just make sure that your ng build --prod is not breaking.

If you want to use the new HttpClient you have change all parts of your code that referencing Http from @angular/http and replace that with HttpClient from @angular/common/http according with styleguide.

Also you have to change to all related .spec files that referencing old Http as well, then test with ng t, unless you does not care about tests.

If you are looking how upgrade all angular related packages more efficiently just look here How do I correctly upgrade angular 2 (npm) to the latest version?

You can use NPM command to update the installed all dependencies.

To update angular

npm install angular@version  (Provide version number) 

Example : npm install angular@4.3 

To download latest angular you can use npm install angular@latest

The command npm update -D && npm update -S will update all packages inside package.json to their latest version.

You can also apply the same command to update HttpClient as wells as all other dependencies

For my application I have upgraded from 4.2.4 to 4.3. Everything works fine. No more issues

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!