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

Skip to content

Commit e83c5ba

Browse files
committed
docs(ngPluralize): update example to use a module
1 parent 4742519 commit e83c5ba

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/ng/directive/ngPluralize.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,17 @@
8989
* @param {number=} offset Offset to deduct from the total number.
9090
*
9191
* @example
92-
<example>
92+
<example module="pluralizeExample">
9393
<file name="index.html">
9494
<script>
95-
function Ctrl($scope) {
96-
$scope.person1 = 'Igor';
97-
$scope.person2 = 'Misko';
98-
$scope.personCount = 1;
99-
}
95+
angular.module('pluralizeExample', [])
96+
.controller('ExampleController', ['$scope', function($scope) {
97+
$scope.person1 = 'Igor';
98+
$scope.person2 = 'Misko';
99+
$scope.personCount = 1;
100+
}]);
100101
</script>
101-
<div ng-controller="Ctrl">
102+
<div ng-controller="ExampleController">
102103
Person 1:<input type="text" ng-model="person1" value="Igor" /><br/>
103104
Person 2:<input type="text" ng-model="person2" value="Misko" /><br/>
104105
Number of People:<input type="text" ng-model="personCount" value="1" /><br/>

0 commit comments

Comments
 (0)