Testing Directives that Use External Templates

The AngularJS folks kind of punt on this one a bit. Their suggestion, if you use a custom AngularJS directive that uses external templates via the templateUrl parameter, is to use something like karma-ng-html2js-preprocessor to precompile HTML templates and thus avoid having to load them over HTTP during tests.

You can get karma-ng-html2js-preprocessor here:

https://github.com/karma-runner/karma-ng-html2js-preprocessor

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset