JSFiddle - React, Tailwind, and code Playground
by andreas_karz
HTML
<div ng-app="app">
<div ng-controller="myController">
Bar:
<select ng-model="foo.bar_ID" data-ng-options="bar.ID as bar.name for bar in bars"></select>
<br />
foo.bar_ID: {{foo.bar_ID}}
</div>
</div>
JavaScript
var app = angular.module('app', []);
app.controller('myController', function ($scope) {
$scope.foo = { bar_ID: 2 };
$scope.bars = [
{
ID: 1,
name: "the first"
},
{
ID: 2,
name: "the second"
},
{
ID: 3,
name: "the third"
}
]
});