Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. imports: [
  2. UniversalModule, // Must be first import. This automatically imports BrowserModule, HttpModule, and JsonpModule too.
  3. RouterModule.forRoot([
  4. { path: '', redirectTo: 'home', pathMatch: 'full' },
  5. { path: 'subscriber', component: SubscriberComponent },
  6. { path: '**', redirectTo: 'home' }
  7. ]),
  8. //HttpModule
  9. FormsModule
  10. ]
  11.  
  12. ngOnInit() {
  13.  
  14. let id = '';
  15. this.activatedRoute.params.subscribe((params: Params) => {
  16. id = params['id'];
  17. if (id != '') {
  18. this.viewData(id);
  19. }
  20. console.log(id);
  21. });
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement