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

View file

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

View file

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

View file

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