mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-09 09:00:34 +08:00
docs(ngPluralize): update example to use a module
This commit is contained in:
@@ -89,16 +89,17 @@
|
||||
* @param {number=} offset Offset to deduct from the total number.
|
||||
*
|
||||
* @example
|
||||
<example>
|
||||
<example module="pluralizeExample">
|
||||
<file name="index.html">
|
||||
<script>
|
||||
function Ctrl($scope) {
|
||||
$scope.person1 = 'Igor';
|
||||
$scope.person2 = 'Misko';
|
||||
$scope.personCount = 1;
|
||||
}
|
||||
angular.module('pluralizeExample', [])
|
||||
.controller('ExampleController', ['$scope', function($scope) {
|
||||
$scope.person1 = 'Igor';
|
||||
$scope.person2 = 'Misko';
|
||||
$scope.personCount = 1;
|
||||
}]);
|
||||
</script>
|
||||
<div ng-controller="Ctrl">
|
||||
<div ng-controller="ExampleController">
|
||||
Person 1:<input type="text" ng-model="person1" value="Igor" /><br/>
|
||||
Person 2:<input type="text" ng-model="person2" value="Misko" /><br/>
|
||||
Number of People:<input type="text" ng-model="personCount" value="1" /><br/>
|
||||
|
||||
Reference in New Issue
Block a user