html - Angular - Automatically select option based on condition -


i working on table consists of several fields, 1 of dropdown values ranging 0% 100%. dropdown menu connected ng-model called:

task.custom_fields 

task variable ng-repeat. field in task object called:

task.finished 

finished has value of 0 or 1, 1, want dropdown menu automatically select value connected 100%. if knows if can done angular syntax appreciate if let me know.

my html code looks follows:

<td md-cell>     <md-select ng-model="task.custom_fields['96203']" placeholder="100%">         <md-option value="0">0%</md-option>         <md-option value="0.1">10%</md-option>         <md-option value="0.2">20%</md-option>         <md-option value="0.3">30%</md-option>         <md-option value="0.4">40%</md-option>         <md-option value="0.5">50%</md-option>         <md-option value="0.6">60%</md-option>         <md-option value="0.7">70%</md-option>         <md-option value="0.8">80%</md-option>         <md-option value="0.9">90%</md-option>         <md-option value="1">100%</md-option>     </md-select> </td> 

an attempt make question less vague, commented well:

what happens is, obtain data database, consists of 'task' objects. each task object has field called 'finished', field indicates whether task done or not. custom field indicates 'progress' of task. therefore obtain data, , finished set 1, want progress 'done', better said, 100%. value of 'finished' field not change while on view, set 1 or 0 beforehand.


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -