Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. constructor(private fs: FakerService, private route: ActivatedRoute) { }
  2.  
  3. this.route.paramMap.pipe(switchMap(params => {
  4. const id = params.get('id'); // ID from RouterLink
  5. return this.fs.getMessages().pipe(map(val => val[+id - 1])
  6. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement