I have my angular app with version 1 so can i upgrade it with angular version 2
We started to design a new project that designated to be built with Angular as each of our previous, the importance of this project is very high and it's going to live and maintained for at least years.
Angular 2.0 has came in beta mode and it seems like everything is about to change, $scope is out, directives are out and the whole DI concept is about to change.
Please help me to sort out.
Updating Angular CLI to the latest version is pretty much simple if you are using Angular 9 or 10 version above. Just update @angular/core and @angular/cli by using ng update command. If you are using Angular material You have to update it as well using ng update command.
Since Angular 2 is not backward compatible, all existing apps built in Angular 1. x are required to be migrated to version 2 because the Angular team will now be focusing more support on latest versions and previous ones will have less and less support in the future.
Updating angular-cli To update angular-cli to a new version, you must update both the global package and your project's local package. Running ng init will check for changes in all the auto-generated files created by ng new and allow you to update yours.
Run ng update @angular/core@12 @angular/cli@12 which should bring you to version 12 of Angular. Angular now requires TypeScript 4.2. ng update will update you automatically.
I think that migrating from Angular 1 to 2 is not nearly as bad as most people think it is.
Basically, you need to break it down and migrate the concepts first...
Almost all of those can be mapped back to 1.x concepts - even if there is not a 1:1 relationship. Once you understand how each of these things are done, it's much easier to decide how to slowly migrate your existing code to the new concepts.
It's hard to cover each and all of those things in a single SO answer, so maybe check out ngmigrate.telerik.com which goes into a lot more detail.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With