Created
October 2, 2015 14:54
-
-
Save tkc/3706beeca4c1c8458d37 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-controller="TestCtrl as test"> | |
<select ng-model="test.selectedItem" ng-options="item as item.name for item in test.items"></select> | |
<pre>@{{test.selectedItem | json}}</pre> | |
</div> | |
app.controller('TestCtrl', function ($scope) { | |
this.items = [ | |
{id: 1, name: 'foo'}, | |
{id: 2, name: 'bar'}, | |
{id: 3, name: 'blah'} | |
]; | |
this.selectedItem = this.items[0]; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment