Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. import { NgModule } from ‘@angular/core’;
  2. import { BrowserModule } from ‘@angular/platform-browser’;
  3. import { RouterModule, Routes } from ‘@angular/router’;
  4.  
  5. import { AppComponent } from ‘./app.component’;
  6. import { StudentComponent } from ‘./student/student.component’;
  7. import { StaffComponent } from ‘./staff/staff.component’;
  8.  
  9. const appRoutes: Routes = [
  10. { path: ‘student’, component: StudentComponent },
  11.   { path: ‘staff’, component: StaffComponent }, 
  12. { path: ‘’, redirectTo: ‘/student’, pathMatch: ‘full’ },
  13. ];
  14. @NgModule({
  15. imports: [
  16.   BrowserModule,
  17.   RouterModule.forRoot(appRoutes)
  18.   ],
  19.   declarations: [
  20.   AppComponent,
  21.   StudentComponent,
  22.   StaffComponent,
  23.   ],
  24.   bootstrap: [ AppComponent ]
  25. })
  26. export class AppModule { }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement