})
export class UserPasswordComponent extends FormReactive implements OnInit, OnDestroy {
error: string
- userId: number
username: string
showPassword = false
+ @Input() userId: number
+
private paramsSub: Subscription
constructor (
this.buildForm({
password: this.userValidatorsService.USER_PASSWORD
})
-
- 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 () {