docs(filters): update examples to use modules

This commit is contained in:
Brian Ford
2014-07-07 23:15:17 -07:00
parent 4349de3d41
commit f75f4bce82

View File

@@ -15,14 +15,15 @@
*
*
* @example
<example>
<example module="currencyExample">
<file name="index.html">
<script>
function Ctrl($scope) {
$scope.amount = 1234.56;
}
angular.module('currencyExample', [])
.controller('ExampleController', ['$scope', function($scope) {
$scope.amount = 1234.56;
}]);
</script>
<div ng-controller="Ctrl">
<div ng-controller="ExampleController">
<input type="number" ng-model="amount"> <br>
default currency symbol ($): <span id="currency-default">{{amount | currency}}</span><br>
custom currency identifier (USD$): <span>{{amount | currency:"USD$"}}</span>
@@ -74,14 +75,15 @@ function currencyFilter($locale) {
* @returns {string} Number rounded to decimalPlaces and places a “,” after each third digit.
*
* @example
<example>
<example module="numberFilterExample">
<file name="index.html">
<script>
function Ctrl($scope) {
$scope.val = 1234.56789;
}
angular.module('numberFilterExample', [])
.controller('ExampleController', ['$scope', function($scope) {
$scope.val = 1234.56789;
}]);
</script>
<div ng-controller="Ctrl">
<div ng-controller="ExampleController">
Enter number: <input ng-model='val'><br>
Default formatting: <span id='number-default'>{{val | number}}</span><br>
No fractions: <span>{{val | number:0}}</span><br>