|
15 | 15 | *
|
16 | 16 | *
|
17 | 17 | * @example
|
18 |
| - <example> |
| 18 | + <example module="currencyExample"> |
19 | 19 | <file name="index.html">
|
20 | 20 | <script>
|
21 |
| - function Ctrl($scope) { |
22 |
| - $scope.amount = 1234.56; |
23 |
| - } |
| 21 | + angular.module('currencyExample', []) |
| 22 | + .controller('ExampleController', ['$scope', function($scope) { |
| 23 | + $scope.amount = 1234.56; |
| 24 | + }]); |
24 | 25 | </script>
|
25 |
| - <div ng-controller="Ctrl"> |
| 26 | + <div ng-controller="ExampleController"> |
26 | 27 | <input type="number" ng-model="amount"> <br>
|
27 | 28 | default currency symbol ($): <span id="currency-default">{{amount | currency}}</span><br>
|
28 | 29 | custom currency identifier (USD$): <span>{{amount | currency:"USD$"}}</span>
|
@@ -74,14 +75,15 @@ function currencyFilter($locale) {
|
74 | 75 | * @returns {string} Number rounded to decimalPlaces and places a “,” after each third digit.
|
75 | 76 | *
|
76 | 77 | * @example
|
77 |
| - <example> |
| 78 | + <example module="numberFilterExample"> |
78 | 79 | <file name="index.html">
|
79 | 80 | <script>
|
80 |
| - function Ctrl($scope) { |
81 |
| - $scope.val = 1234.56789; |
82 |
| - } |
| 81 | + angular.module('numberFilterExample', []) |
| 82 | + .controller('ExampleController', ['$scope', function($scope) { |
| 83 | + $scope.val = 1234.56789; |
| 84 | + }]); |
83 | 85 | </script>
|
84 |
| - <div ng-controller="Ctrl"> |
| 86 | + <div ng-controller="ExampleController"> |
85 | 87 | Enter number: <input ng-model='val'><br>
|
86 | 88 | Default formatting: <span id='number-default'>{{val | number}}</span><br>
|
87 | 89 | No fractions: <span>{{val | number:0}}</span><br>
|
|
0 commit comments