Can you use objects instead of arrays with ng-option and AngularJS -
i using ng-options populate items in select menu.
ng-options="i.option in week.items"
with array populate items.
week.items = [ { 'option': '8 week single transformation | 2 payments of $198.50', 'price' : 198.5 }, .... { 'option': '8 week partner transformation | $597', 'price' : 597 }];
is possible use object instead of array, or ng-options set work arrays?
yes can so. docs well. here example object
$scope.letters = { 'a': 1, 'b': 2 };
and html
ng-options="letter (letter, value) in letters"
Comments
Post a Comment