-
- this.paramsSub = this.route.params.subscribe(routeParams => {
- const userId = routeParams['id']
- this.userService.getUser(userId).subscribe(
- user => this.onUserFetched(user),
-
- err => this.error = err.message
- )
- })
- }
-
- ngOnDestroy () {
- this.paramsSub.unsubscribe()