ng-options
requires a comprehension expression of the form label for value in array
. And you need to add ng-model
for select
to work.
template: '<select ng-model="choice" ng-options="opt for opt in myoptions"></select>',
controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) {
$scope.choice;
$scope.myoptions = ['1','2','3'];
}],
Here is a working plunker: http://plnkr.co/edit/8a6gwpVnMfvXxZzvQBOs?p=preview