Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highlighting Angular project deprecated imports/parts

I googled a lot, but couldn't find any efficient solutions!

How do you replace the deprecated part of an Angular application? Regardless of the size of the application, it would be really inefficient to check every file one by one to see if an import or module is deprecated.

Do you know any good practice to update an Angular project for example from Angular 5 to Angular 7?

And how do you know which parts are deprecated and needs to be replaced? For example, I know import { Http } from '@angular/http' needs to be replaced by import { HttpClient } from '@angular/common/http' or import { HttpClientModule } from '@angular/common/http' in order to use get or post.

How do I find these deprecated parts and how do I know what should I use instead of them?

Thanks in advance!

like image 309
Patrik Alexits Avatar asked Jan 26 '26 05:01

Patrik Alexits


1 Answers

Angular has a cool tool known as update.angular.io.

Select the app complexity, the versions you migrate from and to and you have a list to go.

update.angular.io: params

Here I selected advanced complexity and upgrade from 2 to 7. Here you get your HttpModule replaced with HttpClientModule

update.angular.io: result

like image 110
smnbbrv Avatar answered Jan 28 '26 18:01

smnbbrv



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!