Unable Selected drop down

8 views
Skip to first unread message

Adnan Salahuddin

unread,
Aug 25, 2016, 8:12:08 AM8/25/16
to AngularJS
Hi folks,



<div *ngFor="let section of evaluations.SectionViewModels">
...............
..............
   
<th>Result</th>
   
<th>Rating</th>
...............
..............
   
<tr *ngFor="let skill of section.SkillViewModels">
       
<td>
           
<select [(ngModel)]="skill.Rating" (change)="onSelectResult($event.target.value, skill, section)" name="Rating123">
               
<option *ngFor="let resultRating of resultRatings" [value]="resultRating.ratingNum">{{ resultRating.result }}</option>
           
</select>
       
</td>
       
<td>{{skill.Rating }}</td>
   
</tr>
</div>


where
    resultRatings: Rating[] = [
        { result: "-- Not Applicable --", ratingNum: 0 },
        { result: "Exceptional", ratingNum: 5 },
        { result: "Above Avg", ratingNum: 4 },
        { result: "Satisfactory", ratingNum: 3 },
        { result: "Below Avg", ratingNum: 2 },
        { result: "Unsatisfactory", ratingNum: 1 },
    ];



I want to display or selected Satisfactory in dropdownlist if ratingNum is 3 as skill.Rating.
I think ndModel is not looping correct me if i am wrong.
How to fix it?
I am waiting for your response.
Thanks in Advance!!!

Auto Generated Inline Image 1
Auto Generated Inline Image 2
Reply all
Reply to author
Forward
0 new messages