javascript - angular js array of objects for select with ngOptions -
i have character can contain multiple skills. skills available injected service. want this:
<div ng-repeat="skill in character.getskills()"> <select ng-model="skill" ng-options="select s.tostring() s in getallskills()"></select> <button ng-click="character.removeskill(skill)" >remove skill</button> </div>
with code, select box doesn't work expect it. skills not set in character, , selections not kept in drop down.
am missing something?
thanks in advance, roemer
after all, i'm referencing skill in character.skills array $index property in child scope:
<select ng-model="character.skills[$index]" ng-options="sk sk.tostring() sk in getallskills()"></select>
Comments
Post a Comment