From 86e14e7b44c865fefccb8978d7f23c9583868d72 Mon Sep 17 00:00:00 2001 From: James Vanneman Date: Wed, 26 Mar 2014 21:08:45 -0400 Subject: [PATCH] filters add example add example --- src/ng/filter.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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';