This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NgModule } from '@angular/core'; | |
import { Routes, RouterModule } from '@angular/router'; | |
import { HomeComponentComponent } from './home-component/home-component.component'; | |
import { BigFeatureComponentComponent } from './big-feature-component/big-feature-component.component'; | |
// New code | |
const routes: Routes = [ | |
{ path: '', pathMatch: 'full', redirectTo: 'home'}, | |
{ path: 'home', component: HomeComponentComponent}, | |
{ path: 'bigComponent', component: BigFeatureComponentComponent} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Creating our HomeComponent **/ | |
ng generate component HomeComponent --spec=false | |
/** Creating our BigFeatureComponent **// | |
ng generate component BigFeatureComponent --spec=false | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** This assumes you have @angular/cli installed **/ | |
/** creating our Angular application **/ | |
ng new fancy-app --routing | |
NewerOlder