Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit d5305d5

Browse files
committed
docs(select): update example to use a module
1 parent f9d8819 commit d5305d5

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/ng/directive/select.js

+13-12
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,22 @@ var ngOptionsMinErr = minErr('ngOptions');
7272
* `value` variable (e.g. `value.propertyName`).
7373
*
7474
* @example
75-
<example>
75+
<example module="selectExample">
7676
<file name="index.html">
7777
<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+
}]);
8889
</script>
89-
<div ng-controller="MyCntrl">
90+
<div ng-controller="ExampleController">
9091
<ul>
9192
<li ng-repeat="color in colors">
9293
Name: <input ng-model="color.name">

0 commit comments

Comments
 (0)