Angular: select 14386570
http://angularjs.org/
by mrajcok
HTML
<div ng-controller="MyCtrl">
<select ng-options="size as size.name for size in sizes " ng-model="item" ng-change="update()"></select>
{{item.code}} {{item.name}}
</div>
JavaScript
var myApp = angular.module('myApp',[]);
//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});
function MyCtrl($scope) {
$scope.sizes = [ {code: 1, name: 'n1'}, {code: 2, name: 'n2'}];
$scope.update = function() {
console.log($scope.item.code, $scope.item.name)
}
}