I'm new to Angular 5. I created a service that successfully builds an
observable option of array of type from my data model. I've verified that
I received data.
but I can't seem to populate a select with options.
To simplify things, I created an simple array in my typescript and try to
use that in the option tag instead. It still wont work. So I must be
something wrong. Please help.
here's the definition of the array in typescript:
classificiations = [
{ ClassificationId: null, Name: 'None' },
{ ClassificationId: '1', Name: 'Classifified' },
{ ClassificationId: '2', Name: 'Simsec' },
{ ClassificationId: '3', Name: 'Confidential' },
{ ClassificationId: '4', Name: 'Secret' },
{ ClassificationId: '5', Name: 'Top Secret' }];
and then here's the markup in html:
<select
name="ddlRequestClassification2">
<option *ngFor="let itm of classifications"
[value]="itm.ClassificationId">{{itm.Name}}</option>
</select>
I had referenced ngModel in the select, but took that out just to see if it
would simplify things more, but that didn't improve things either.
--
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.