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

Skip to content

Commit 39c7c90

Browse files
committed
docs(ngList): update example to use a module
1 parent d28a0bf commit 39c7c90

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/ng/directive/input.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2274,14 +2274,15 @@ var minlengthDirective = function() {
22742274
* specified in form `/something/` then the value will be converted into a regular expression.
22752275
*
22762276
* @example
2277-
<example name="ngList-directive">
2277+
<example name="ngList-directive" module="listExample">
22782278
<file name="index.html">
22792279
<script>
2280-
function Ctrl($scope) {
2281-
$scope.names = ['igor', 'misko', 'vojta'];
2282-
}
2280+
angular.module('listExample', [])
2281+
.controller('ExampleController', ['$scope', function($scope) {
2282+
$scope.names = ['igor', 'misko', 'vojta'];
2283+
}]);
22832284
</script>
2284-
<form name="myForm" ng-controller="Ctrl">
2285+
<form name="myForm" ng-controller="ExampleController">
22852286
List: <input name="namesInput" ng-model="names" ng-list required>
22862287
<span class="error" ng-show="myForm.namesInput.$error.required">
22872288
Required!</span>

0 commit comments

Comments
 (0)