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

Skip to content

Commit 32b5078

Browse files
committed
docs(ngList): update example to use a module
1 parent bfedafd commit 32b5078

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
@@ -1483,14 +1483,15 @@ var requiredDirective = function() {
14831483
* specified in form `/something/` then the value will be converted into a regular expression.
14841484
*
14851485
* @example
1486-
<example name="ngList-directive">
1486+
<example name="ngList-directive" module="listExample">
14871487
<file name="index.html">
14881488
<script>
1489-
function Ctrl($scope) {
1490-
$scope.names = ['igor', 'misko', 'vojta'];
1491-
}
1489+
angular.module('listExample', [])
1490+
.controller('ExampleController', ['$scope', function($scope) {
1491+
$scope.names = ['igor', 'misko', 'vojta'];
1492+
}]);
14921493
</script>
1493-
<form name="myForm" ng-controller="Ctrl">
1494+
<form name="myForm" ng-controller="ExampleController">
14941495
List: <input name="namesInput" ng-model="names" ng-list required>
14951496
<span class="error" ng-show="myForm.namesInput.$error.required">
14961497
Required!</span>

0 commit comments

Comments
 (0)