angularjs - Mock a Angular 1.5 component in unit tests -
i have basic angular 1.5 component looking :
angular .module('app') .component('techs', { templateurl: 'app/techs/techs.html', controller: techscontroller }); and mock only component , not whole app because angular.mock.module('app') mocks every components of app. there way ?
tried angular.mock.module('techs') have error occuring :
failed instantiate module techs due to: module 'techs' not available! either misspelled module name or forgot load
you should inject components $componentcontroller.
forex: component = $componentcontroller('component', {yourscope}, {yourbindings});
Comments
Post a Comment