Advertisement
Guest User

Untitled

a guest
May 6th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. @Routes([
  2. { path: '/', component: StartComponent },
  3. {path: '/:projId/:userName', component: ProjectListComponent},
  4. { path: '*', component: StartComponent },
  5. ])
  6.  
  7. import {Component, OnInit} from '@angular/core';
  8. import {RouteParams} from '@angular/router-deprecated';
  9.  
  10. @Component({
  11. ...
  12. })
  13. export class ProjectListComponent implements OnInit {
  14. userName:string;
  15. projId:string;
  16.  
  17. constructor(private params:RouteParams) {
  18. this.userName = params.get('userName');
  19. this.projId = params.get('projId');
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement