@@ -72,21 +72,22 @@ var ngOptionsMinErr = minErr('ngOptions');
72
72
* `value` variable (e.g. `value.propertyName`).
73
73
*
74
74
* @example
75
- <example>
75
+ <example module="selectExample" >
76
76
<file name="index.html">
77
77
<script>
78
- function MyCntrl($scope) {
79
- $scope.colors = [
80
- {name:'black', shade:'dark'},
81
- {name:'white', shade:'light'},
82
- {name:'red', shade:'dark'},
83
- {name:'blue', shade:'dark'},
84
- {name:'yellow', shade:'light'}
85
- ];
86
- $scope.myColor = $scope.colors[2]; // red
87
- }
78
+ angular.module('selectExample', [])
79
+ .controller('ExampleController', ['$scope', function($scope) {
80
+ $scope.colors = [
81
+ {name:'black', shade:'dark'},
82
+ {name:'white', shade:'light'},
83
+ {name:'red', shade:'dark'},
84
+ {name:'blue', shade:'dark'},
85
+ {name:'yellow', shade:'light'}
86
+ ];
87
+ $scope.myColor = $scope.colors[2]; // red
88
+ }]);
88
89
</script>
89
- <div ng-controller="MyCntrl ">
90
+ <div ng-controller="ExampleController ">
90
91
<ul>
91
92
<li ng-repeat="color in colors">
92
93
Name: <input ng-model="color.name">
0 commit comments