Joined November 2012
·
Posted to
AngularJS: Including multiple controllers in a directive.
over 1 year
ago
@paprikkastudio Commonly when forms or form elements are being used. Since ngModel's controller api provides services for data-binding, validation, CSS updates, value formatting and parsing. A directive could require the ngModel controller for validation of an input while also needing to call a method in its parent directives controller.
Here's an example of it being used in the Angular source code: https://github.com/angular/angular.js/blob/master/src/ng/directive/input.js#L1223
Achievements
449 Karma
30,375 Total ProTip Views
![](https://dj1symwmxvldi.cloudfront.net/assets/badges/walrus-1f517cbbd8f030099b8386c53d4ee40fece3fa146b6362accb3abddb436482cb.png)
Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos
![](https://dj1symwmxvldi.cloudfront.net/assets/badges/cub-d811dfda174e9ca232964477c16369e9ed8caf4a47d746348a358f3579b8ffdc.png)
Cub
Have at least one original jQuery or Prototype open source repo
![](https://dj1symwmxvldi.cloudfront.net/assets/badges/honeybadger-e6a507524dd5b8b273f39b437d9da1c1bbbb434a59a060a1fe67e3ad83736261.png)
Honey Badger
Have at least one original Node.js-specific repo
![](https://dj1symwmxvldi.cloudfront.net/assets/badges/mongoose-299fb33af2a4e416505b484d73e79ee3ff1840f3c7385d6bbbc158f76be054cb.png)
Mongoose
Have at least one original repo where Ruby is the dominant language
![](https://dj1symwmxvldi.cloudfront.net/assets/badges/forked1-63f23ad054823f6065b4526f8552dbc2c4fbaa75d22db7150d700201218ac426.png)
Forked
Have a project valued enough to be forked by someone else
![](https://dj1symwmxvldi.cloudfront.net/assets/badges/nephilakomaci-ff83276c8b6c472f151b6e3fbcbc31067ae72425f57a22742f9124501b02cd71.png)
Nephila Komaci
Have at least one original repos where PHP is the dominant language
Great, i'm glad it helped!