Last active
May 28, 2020 13:57
-
-
Save SevdaCimen/0465523d7e703aedba747998adb7a212 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onChange(): void { | |
this.form.get('studentNumber').valueChanges.subscribe(number => { | |
//assumed that student number must be 5 digits | |
if (number.length === 5) { | |
this._service.studentInfo(number).subscribe(response => { | |
this.data = response; | |
}); | |
} | |
} | |
else { | |
this.data = {} as StudentModel; | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment