mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-20 07:15:31 +08:00
committed by
Peter Bacon Darwin
parent
edab80cddb
commit
23723298f9
@@ -73,7 +73,24 @@
|
||||
*
|
||||
* @param {String} name Name of the filter function to retrieve
|
||||
* @return {Function} the filter function
|
||||
*/
|
||||
* @example
|
||||
<example name="$filter" module="filterExample">
|
||||
<file name="index.html">
|
||||
<div ng-controller="MainCtrl">
|
||||
<h3>{{ originalText }}</h3>
|
||||
<h3>{{ filteredText }}</h3>
|
||||
</div>
|
||||
</file>
|
||||
|
||||
<file name="script.js">
|
||||
angular.module('filterExample', [])
|
||||
.controller('MainCtrl', function($scope, $filter) {
|
||||
$scope.originalText = 'hello';
|
||||
$scope.filteredText = $filter('uppercase')($scope.originalText);
|
||||
});
|
||||
</file>
|
||||
</example>
|
||||
*/
|
||||
$FilterProvider.$inject = ['$provide'];
|
||||
function $FilterProvider($provide) {
|
||||
var suffix = 'Filter';
|
||||
|
||||
Reference in New Issue
Block a user