2 ms·
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 c
by Bahamut 12y ago
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/directive/navBar.js#L93 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.