JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0-rc.1/angular.js"></script>
<body ng-app="myApp">
<div ng-controller="AppController">
CLICK THIS: <button ng-click="changeAnakinsName()">Change Anakins Name</button>
<br/><br/>
WILL NOT UPDATE:
<select ng-model="sith" ng-options="jedi.name for jedi in jedis">
<option value="">-- choose the sith --</option>
</select>
<br/>
WILL UPDATE:
<select ng-model="sith" ng-options="jedi.name as jedi.name for jedi in jedis">
<option value="">-- choose the sith --</option>
</select>
<pre>{{jedis | json}}</pre>
</div>
</body>
JavaScript
var app = angular.module('myApp', []);
app.controller('AppController', function ($scope) {
$scope.sith = null;
$scope.jedis = [
{
name: 'Anakin Skywalker'
},
{
name: 'Luke Skywalker'
},
{
name: 'Obi-Wan Kenobi'
}
];
$scope.changeAnakinsName = function () {
$scope.jedis[0].name = 'Darth Vader';
console.log($scope.jedis);
}
});