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

Skip to content

Commit 5bd8613

Browse files
committed
docs(ngValue): update example to use a module
1 parent 32b5078 commit 5bd8613

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
@@ -1583,15 +1583,16 @@ var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/;
15831583
* of the `input` element
15841584
*
15851585
* @example
1586-
<example name="ngValue-directive">
1586+
<example name="ngValue-directive" module="valueExample">
15871587
<file name="index.html">
15881588
<script>
1589-
function Ctrl($scope) {
1590-
$scope.names = ['pizza', 'unicorns', 'robots'];
1591-
$scope.my = { favorite: 'unicorns' };
1592-
}
1589+
angular.module('valueExample', [])
1590+
.controller('ExampleController', ['$scope', function($scope) {
1591+
$scope.names = ['pizza', 'unicorns', 'robots'];
1592+
$scope.my = { favorite: 'unicorns' };
1593+
}]);
15931594
</script>
1594-
<form ng-controller="Ctrl">
1595+
<form ng-controller="ExampleController">
15951596
<h2>Which is your favorite?</h2>
15961597
<label ng-repeat="name in names" for="{{name}}">
15971598
{{name}}

0 commit comments

Comments
 (0)