Getting started default files(main.ts,app.component.ts,app.module,app,conponent.html,) notations.
1). ng g c home -s --spec false
2).ng g m account
3).cd D:\DntApp\src\app\account
4).ng g c login -s --spec false
5).ng g c register -s --spec false
6).cd D:\DntApp\src\app
7).ng generate module app-routing --flat --module=app
Notes*
1).
imports: [ RouterModule.forRoot(routes) ],
The method is called forRoot() because you configure the router at the application's root level.
The forRoot() method supplies the service providers and directives needed for routing,
and performs the initial navigation based on the current browser URL.
2). The <router-outlet> tells the router where to display routed views.
The RouterOutlet is one of the router directives that became available to the AppComponent because AppModule imports AppRoutingModule which exported RouterModule.
3). <a routerLink="/heroes">Heroes</a>
Here routerLink is the selector for the RouterLink directive that turns user clicks into router navigations. It's another of the public directives in the RouterModule.
4). { path: '', redirectTo: '/dashboard', pathMatch: 'full' },
1). ng g c home -s --spec false
2).ng g m account
3).cd D:\DntApp\src\app\account
4).ng g c login -s --spec false
5).ng g c register -s --spec false
6).cd D:\DntApp\src\app
7).ng generate module app-routing --flat --module=app
Notes*
1).
imports: [ RouterModule.forRoot(routes) ],
The method is called forRoot() because you configure the router at the application's root level.
The forRoot() method supplies the service providers and directives needed for routing,
and performs the initial navigation based on the current browser URL.
2). The <router-outlet> tells the router where to display routed views.
The RouterOutlet is one of the router directives that became available to the AppComponent because AppModule imports AppRoutingModule which exported RouterModule.
3). <a routerLink="/heroes">Heroes</a>
Here routerLink is the selector for the RouterLink directive that turns user clicks into router navigations. It's another of the public directives in the RouterModule.
4). { path: '', redirectTo: '/dashboard', pathMatch: 'full' },

No comments:
Post a Comment