diff --git a/src/ng/filter.js b/src/ng/filter.js index 090b32ca6ead..92c9534aa2d4 100644 --- a/src/ng/filter.js +++ b/src/ng/filter.js @@ -73,7 +73,29 @@ * * @param {String} name Name of the filter function to retrieve * @return {Function} the filter function - */ + * @example + + +
+

{{ hello }}

+
+
+ + + angular.module('ngFilterExample', []); + angular.module('ngFilterExample').filter("myUpperCaseFilter", function(){ + return function(word){ + return word.toUpperCase(); + }; + }); + + angular.module('ngFilterExample') + .controller('MainCtrl', function ($scope, $filter) { + $scope.hello = $filter('myUpperCaseFilter')('lowercase hello!'); + }); + +
+ */ $FilterProvider.$inject = ['$provide']; function $FilterProvider($provide) { var suffix = 'Filter';