mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
fix(filter): remove the $ prefix from filter service ids
This commit is contained in:
parent
b97c6e5f74
commit
c28662d28d
4 changed files with 8 additions and 8 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in a new issue