Before Update
-
If you are using
HttpModule
, then change it toHttpClientModule
. -
If you are using
Http
service, then change it toHttpClient
Service. -
Make sure you are using
Node 12
or later. Click below link to update your Node.
-
Once you and all of your dependencies have updated to RxJS 6, remove
rxjs-compat
-
If you use the Angular Service worker, migrate any
versionedFiles
to thefiles
array. The behavior is the same.
Update to Angular 8 version
You can update to angular 8 framework and CLI by using this command.
|
|
When using new versions of the CLI, you will be asked if you want to opt-in to share your CLI usage data. You can also add your own Google Analytics account. This lets us make better decisions about which CLI features to prioritize, and measure the impact of our improvements. Learn more on angular.io
If you use ViewChild
or ContentChild
, we’re updating the way we resolve these queries to give developers more control. You must now specify that change detection should run before results are set. Example: @ContentChild('foo', {static: false}) foo !: ElementRef;
. ng update
will update your queries automatically, but it will err on the side of making your queries static
for compatability. Learn more on angular.io.
After Update
For lazy loaded modules via the router, importing via string is deprecated. ng update
will take care of this automatically.
In version 8, the string syntax for the loadChildren route specification was deprecated, in favor of new syntax that uses import()
syntax.
Before
|
|
After
|
|
Summary
The Angular team is doing a great job — which makes our job (and life) much easier. With every version, the update is smoother and smoother. So the update should be painless and probably won’t take a lot of time.
Further Reading
Create Your First React App In Easy Steps
Update Angular 6 to Angular 7 version
How to create Restful CRUD API with Node.js MongoDB and Express.js