I would like to pass an array of objects to a directive, to use it as options in a select:
.directive('myDirective', ['$window', function ($window) {
return {
restrict: 'AE',
scope: {
users: '=myDirective',
},
template:
'<select id="myUsers" ng-options="user.id as user.name for user in users"></select>'
};
and in the html
<div my-directive="users"></div>
the select dropdown is rendered empty. What am I doing wrong?