Adding a combobox or deleting a combobox on clicking submit isn't working. I am calling a function in scope when submit is clicked.
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Text Box</title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
<script>
angular.module('controllerAsExample', []).controller('SettingsController1', function ($scope)
{
$scope.comboBox = []
$scope.addDropDown = function ()
{
$scope.comboBox.push('');
}
$scope.deleteDropDown = function (index)
{
$scope.comboBox.splice(index, 1);
}
});
</script>
</head>
<body ng-app="controllerAsExample">
<div id="ctrl-as-exmpl" ng-controller="SettingsController1">
<input type="text" ng-repeat="dropDown in comboBox track by $index" />
<select ng-model="newValue" ng-options="n in n[]"></select>
<input type="submit" ng-submit="addDropDown()" value="Add" />
<input type="submit" ng-submit="deleteDropDown()" value="Delete" />
</div>
</body>
<select ng-model="newValue" ng-options="n in n[]"></select>throws an error. What is it supposed to do?