var options = [
{name: ['black', 'green', 'black'], shade:'dark'},
{name: ['white', 'black', 'white'], shade:'light'},
{name: ['grey', 'white', 'yellow'], shade:'dark'},
{name: ['red', 'black', 'red'], shade:'dark'},
{name: ['yellow', 'green', 'black'], shade:'light'}
];
var app = angular.module('module', []);
app.controller('MainCtrl', function($scope) {
$scope.options = options;
$scope.$watch('myselect', function(val) {
console.log(val);
});
});
</script>
</head>
<body ng-controller="MainCtrl">
<div ng-repeat="option in options">
<select ng-model="myselect" ng-options=" item for item in option.name"></select>
</div>
</body>
I am new at angular and even at web developing. I need to select one of the name's array element and send it to the server. I am trying to do it like this, but nothing happening. Thank you for any help.