December 2014
Intermediate to advanced
272 pages
8h 17m
English
Testing your custom filters in AngularJS can be very simple if you keep them straightforward. To illustrate this, consider the following custom filter and test:
myModule.filter('nospace', function() { return function(text){ return text.replace(' ', ''); }});var nospace = $filter('nospace');expect(nospace('my words')).toEqual('mywords');
Read now
Unlock full access