In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces the Angular5.2 to 6.1 upgrade example analysis, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
As mentioned in the previous article, angular6 cannot be upgraded basically without feeling like Angular4 to Angular5 because of some slightly larger changes. Here, combined with official tips, briefly sort out the key points of upgrading Angular5.2 to the current stable 6.1.
Prepare beforehand
Change content
In addition, you need to confirm the following:
Tsconfig.json: preserveWhitespaces is set to off (V6 default)
With the use of scripts in package.json, all cli commands use two horizontal lines-incoming parameters (POSIX specification)
If the ngModelChange behavior changes, please make sure that you use the relevant method and whether the action is normal after the upgrade.
When Typescript uses strict mode (when tsconfig.json 's strict is set to true), update tsconfig.json to invalidate strictPropertyInitialization, or remove the initialization of attributes in ngOnInit
Update
Update cli
Node version confirmation: Node8 and above
Update local and global angular cli
Modify the configuration file angular.json
You can do this using the following command:
Sudo npm install-g @ angular/cli@6.1.5
Npm install @ angular/cli@6.1.5
Ng update @ angular/cli
Update angular framework
Update Angular framework to V6 and the corresponding RxJS and TypeScript versions
Ng update @ angular/core
Update Angular Material
Ng update @ angular/material
Update other package
Ng update
Modification of rxjs
Rxjs can be compatible with rxjs-compat mode, and then removed after the correspondence is completed.
Thank you for reading this article carefully. I hope the article "sample Analysis of Angular5.2 to 6.1 upgrade" shared by the editor will be helpful to you. At the same time, I also hope you will support us and follow the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.