Angularjs ng-select with object
How to use Angularjs ng-select with object
http://plnkr.co/edit/8zLweabwviiN4u7oyNd1?p=preview
I could make it work with Array / array of objects. But, but not with object.
<body ng-controller="MainCtrl">
<div class="highlight">fm:{{fm}}</div>
<select ng-model="fm.currentActivity" ng-options="act for act in
activities"></select>
<select ng-model="fm.currentActivity2" value as key for (key ,
value) in activities2"></select>
</body>
app.controller('MainCtrl', function($scope) {
$scope.sel = "tmpl1";
$scope.fm = {};
$scope.activities = [
"x",
"y",
"z"
];
$scope.activities2 = {
"a": 1,
"b": 2
};
});
No comments:
Post a Comment