I need to use data i got from a service as drop down options in my form.
instead of this
public gender = [
{ value: 'Male', display: 'Male' },
{ value: 'Female', display: 'Female' }
]
And the form
ngOnInit() {
this.student = this.fb.group({
first_name: ['', [Validators.required, Validators.minLength(2)]],
surname: ['', [Validators.required, Validators.minLength(2)]],
other_names: [''],
gender: [''],
houses: ['']
});
}
I would rather want the response from server so that it could be more
dynamic. If i am doing it the wrong way kindly help me out. A noob!
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.