fix(filter): remove the $ prefix from filter service ids

This commit is contained in:
Igor Minar 2011-12-06 12:20:35 -08:00
parent b97c6e5f74
commit c28662d28d
4 changed files with 8 additions and 8 deletions

View file

@ -286,7 +286,7 @@ This example shows how to implement a custom HTML editor widget in Angular.
this.htmlContent = '<b>Hello</b> <i>World</i>!';
}
HTMLEditorWidget.$inject = ['$element', 'html$Filter'];
HTMLEditorWidget.$inject = ['$element', 'htmlFilter'];
function HTMLEditorWidget(element, htmlFilter) {
var self = this;

View file

@ -30,7 +30,7 @@
* }
* </pre>
*
* The filter function is registered with the `$injector` under the filter name suffixe with `$Filter`.
* The filter function is registered with the `$injector` under the filter name suffixe with `Filter`.
* <pre>
* it('should be the same instance', inject(
* function($filterProvider) {
@ -38,8 +38,8 @@
* return ...;
* });
* },
* function($filter, revers$Filter) {
* expect($filter('reverse')).toBe(reverse$Filter);
* function($filter, reverseFilter) {
* expect($filter('reverse')).toBe(reverseFilter);
* });
* </pre>
*
@ -76,11 +76,11 @@
*/
$FilterProvider.$inject = ['$provide'];
function $FilterProvider($provide) {
var suffix = '$Filter';
var suffix = 'Filter';
function register(name, factory) {
return $provide.factory(name + suffix, factory);
};
}
this.register = register;
this.$get = ['$injector', function($injector) {

View file

@ -29,7 +29,7 @@
this.html = '<b>Hello</b> <i>World</i>!';
}
HTMLEditorWidget.$inject = ['$element', 'html$Filter'];
HTMLEditorWidget.$inject = ['$element', 'htmlFilter'];
function HTMLEditorWidget(element, htmlFilter) {
var self = this;

View file

@ -198,7 +198,7 @@ describe('parser', function() {
expect(function() {
scope.$eval("1|nonexistent");
}).toThrow(new Error("Unknown provider for 'nonexistent$Filter'."));
}).toThrow(new Error("Unknown provider for 'nonexistentFilter'."));
scope.offset = 3;
expect(scope.$eval("'abcd'|substring:1:offset")).toEqual("bc");