Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0a10425

Browse files
committed
docs(ngValue): update example to use a module
1 parent 39c7c90 commit 0a10425

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/ng/directive/input.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2374,15 +2374,16 @@ var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/;
23742374
* of the `input` element
23752375
*
23762376
* @example
2377-
<example name="ngValue-directive">
2377+
<example name="ngValue-directive" module="valueExample">
23782378
<file name="index.html">
23792379
<script>
2380-
function Ctrl($scope) {
2381-
$scope.names = ['pizza', 'unicorns', 'robots'];
2382-
$scope.my = { favorite: 'unicorns' };
2383-
}
2380+
angular.module('valueExample', [])
2381+
.controller('ExampleController', ['$scope', function($scope) {
2382+
$scope.names = ['pizza', 'unicorns', 'robots'];
2383+
$scope.my = { favorite: 'unicorns' };
2384+
}]);
23842385
</script>
2385-
<form ng-controller="Ctrl">
2386+
<form ng-controller="ExampleController">
23862387
<h2>Which is your favorite?</h2>
23872388
<label ng-repeat="name in names" for="{{name}}">
23882389
{{name}}

0 commit comments

Comments
 (0)