docs(ngValue): update example to use a module

This commit is contained in:
Brian Ford
2014-07-07 23:30:02 -07:00
parent 32b507890e
commit 5bd8613168
+7 -6
View File
@@ -1583,15 +1583,16 @@ var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/;
* of the `input` element
*
* @example
<example name="ngValue-directive">
<example name="ngValue-directive" module="valueExample">
<file name="index.html">
<script>
function Ctrl($scope) {
$scope.names = ['pizza', 'unicorns', 'robots'];
$scope.my = { favorite: 'unicorns' };
}
angular.module('valueExample', [])
.controller('ExampleController', ['$scope', function($scope) {
$scope.names = ['pizza', 'unicorns', 'robots'];
$scope.my = { favorite: 'unicorns' };
}]);
</script>
<form ng-controller="Ctrl">
<form ng-controller="ExampleController">
<h2>Which is your favorite?</h2>
<label ng-repeat="name in names" for="{{name}}">
{{name}}