Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Filter docs #6871

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion src/ng/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,29 @@
*
* @param {String} name Name of the filter function to retrieve
* @return {Function} the filter function
*/
* @example
<example module="ngFilterExample">
<file name="index.html">
<div ng-controller="MainCtrl">
<h3>{{ hello }} </h3>
</div>
</file>

<file name="script.js">
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!');
});
</file>
</example>
*/
$FilterProvider.$inject = ['$provide'];
function $FilterProvider($provide) {
var suffix = 'Filter';
Expand Down