News for hackers. Stuff that matters.
Re:AngularJS Style Guide by Bahamut on Sunday October 12, 2014 @04:17PM (#8446456)
Directives are more powerful - for example, child directives can require the parent directive's controller and make use of it, which can lead to some powerful control flow.

You can also define a controller and have the directive consume it via named reference - here is one example that makes use of this: https://github.com/driftyco/ionic/blob/master/js/angular/dir...

Controllers should be consumed this way, so that they become easier to test. Testing directives can get complicated.

There are no comments on this comment yet.