Angular 2 introduces a new router based on components, which, as we've seen before, are similar to controllers.
- [Voiceover] Now we move on to the third video…of the section, where we're going…to introduce a new Angular 2 component router.…First we're going to take a look…at what a new component router is…and explain why using the latest 1.x router…will elevate our migration process.…Then we're going to use the latest 1.x router…implementation in our simple application.…You may already know that angular 1.x as a router used…to load specific HTML views in a placeholder HTML element…base a new orange and cheese.…
If your application does not currently use a router…bare with me as it is very likely…that you will have to use a component router…in Angular 2 anyways.…Angular 2 has a similar router with one major difference.…The new router can load the multiple components…on a same web page, where Angular 1.x could have…just one user page.…Since we don't have multiple views yet…and components are specific to Angular 2,…what can we do now to help with the migration process?…Well as you can see that sample of code…the new component router has a syntax that will remind you…
Angular 2 is a technical and conceptual overhaul of its hugely popular predecessor, AngularJS. To stay ahead, developers who have built and maintained projects with AngularJS need to be able to transition them to Angular 2. Migrating to Angular 2 demonstrates how to create and execute an effective migration plan for Angular applications. It opens with an introduction to the major changes and additions brought by the new framework. Then author Alain Chautard reviews a plan to migrate a sample weather application from its original Angular 1.x codebase.
Learn how to migrate blocks of code incrementally, as opposed to porting code in bulk, and get a brief introduction to TypeScript and ECMAScript 6. Along the way, Alain shows you how to gradually deprecate $scope, upgrade services, work with the component router, transition forms, and more.
By the end of this course, you'll be up to speed with the fundamental building blocks of Angular 2 development, and fully capable (and confident) transitioning existing Angular 1.x projects to the new environment, ready to explore everything that Angular 2 has to offer.
- What's new in Angular 2?
- Migrating incrementally
- What are TypeScript and ES6?
- Cleaning up $scopes
- Making components
- Using TypeScript classes
- Upgrading 1.x services, components, and controllers
- Best practices for Angular 2