You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You have a directive controller which defines methods on $scope, but many times we need to define methods on this, so that the controller can be used in other directives which get transcluded into the current one. (the controller gets injected as an addl param on the child directive's link function, so long as there is a require parameter of "^parentDirective".
Any idea if there's a way to test these?
My thinking is I may not want to test the controller as it's internals, and so long as I'm testing the behaviors of the directives I'm happy with it from a BDD perspective. If I was aiming for 100% coverage that would be another story.
The text was updated successfully, but these errors were encountered:
Sorry if there's a better place for comment, but I didn't find one on your rendered blog or in the source for it.
Regarding https://github.com/dagingaa/dagingaa.github.com/blob/master/_posts/2014-03-03-testing-angular-directive-controllers-with-jasmine-and-karma.md
You have a directive controller which defines methods on $scope, but many times we need to define methods on
this
, so that the controller can be used in other directives which get transcluded into the current one. (the controller gets injected as an addl param on the child directive's link function, so long as there is a require parameter of "^parentDirective".Any idea if there's a way to test these?
My thinking is I may not want to test the controller as it's internals, and so long as I'm testing the behaviors of the directives I'm happy with it from a BDD perspective. If I was aiming for 100% coverage that would be another story.
The text was updated successfully, but these errors were encountered: