July 2017
Intermediate to advanced
454 pages
10h 1m
English
Angular has completely redefined the router. It is good practice to upgrade the router module by module. Angular has a special tag, <router-outlet>, that displays or loads the routed views. This should be in a template of the root component. So for your application, we need to create a root component named AppComponent:
import { Component } from '@angular/core';
@Component({
selector: 'your-app',
template: '<router-outlet></router-outlet>'
})
export class AppComponent { }
This is an instruction to load the root component into <your-app> if it is found in a web page. So let us replace the ng-view directive in index.html with the application element <your-app>:
<body> <your-app></your-app> </body>
We need to create ...
Read now
Unlock full access