Hi I am trying to add a button in my ionic app to add a list item which has a dropdown options in it. So far I have:
HTML:
<div class="list" ng-repeat="option in options">
<button class="button button-block button-positive" ng-click="addOption()">
Add
</button>
<label class="item item-input item-select">
<div class="input-label">
Name
</div>
<select>
<option>Not interested</option>
<option> Yes</option>
</select>
</div>
JS:
$scope.option = $localStorage;
$scope.addOption = function() {
$scope.option.push();
};
$scope.closeOption = function(index) {
$scope.alerts.splice(index, 1);
};
I know the above must be wrong but I cant see where? I am fairly new to angular JS
You need to make the select menu so that there is one option
for every option in the array.
<select>
<option ng-repeat="x in option">{{x}}</option>
</select>
Also you are not specifying what is being added to option
.
You have to define the class as dropdown to display the options as list.