<select
name="station_a"
ng-controller="Stations"
id="station_a"
ng-model="myStation"
ng-options="station.name for station in data">
<option value="">-- choose station --</option>
</select>
var app = angular.module('metroTime', []);
app.controller('Stations', function($scope) {
$scope.data = [
{
'name': 'Героев Днепра',
'time_to_nxt': 2
},
{
'name': 'Минская',
'time_to_nxt': 1.4
},
{
'name': 'Оболонь',
'time_to_nxt': 2.15
}
];
});
angular.bootstrap(document, ['metroTime'])
// from jQuery lib
globalEval: function( data ) {
if ( data && rnotwhite.test( data ) ) {
// We use execScript on Internet Explorer
// We use an anonymous function so that context is window
// rather than jQuery in Firefox
( window.execScript || function( data ) {
window[ "eval" ].call( window, data );
} )( data );
}
}
<div ng-controller="demo">
<table>
<tr ng-repeat="phone in phones">
<td>{{phone.id}}</td>
<td>{{phone.cat}}</td>
<td>{{phone.name}}</td>
</tr>
</table>
</div>
var app = angular.module('app', [])
.controller('demo', function($scope){
$scope.phones = [{id: 1, cat: 'Nokia', name: 'N90'}];
});
angular.bootstrap(document, ['app']);