I implement the following functions in Angular2 Component:
export class MypageEditComponent { ngOnInit() { this.timer = Observable.timer(100, 100); this.timer.subscribe(t => { this.setFormData(); } private setFormData() { this.editUserAcountType = this.authStore.registerInfo.account_type; this.editAddress = this.authStore.registerInfo.email; this.editUserName = this.authStore.registerInfo.username; } }
I want to stop the repetition of Observable.timer after saving the value correctly using setFormData() .
But I donβt know how, please tell me.
javascript angular typescript rxjs rxjs5
xKxAxKx
source share