diff options
Diffstat (limited to 'docs/content/guide/dev_guide.unit-testing.ngdoc')
| -rw-r--r-- | docs/content/guide/dev_guide.unit-testing.ngdoc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/content/guide/dev_guide.unit-testing.ngdoc b/docs/content/guide/dev_guide.unit-testing.ngdoc index 8b4d4687..a14ddd39 100644 --- a/docs/content/guide/dev_guide.unit-testing.ngdoc +++ b/docs/content/guide/dev_guide.unit-testing.ngdoc @@ -252,11 +252,13 @@ format. They are important because they remove the formatting responsibility fro logic, further simplifying the application logic. <pre> -angular.module.ng.$filter('length', function(text){ - return (''+(text||'')).length; +myModule.filter('length', function() { + return function(text){ + return (''+(text||'')).length; + } }); -var length = angular.module.ng.$filter('length'); +var length = $filter('length'); expect(length(null)).toEqual(0); expect(length('abc')).toEqual(3); </pre> |
