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
{{ message }}
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
It's a pain to have to use link to pass other directives' controllers to your own. e.g I want to use a ngModelController instance with a directive that has a controller but no link.
At the people are having to resort to a potentially superfluous link, and some nasty boiler-plate:
app.directive("myThing",function(){return{require: ["myThing","ngModel"],controller: function(){// can't use ngModel herethis.setNgModel=function(){}},link: function(scope,element,attrs,ctrls){varmyCtrl=ctrls[0];myCtrl.setNgModel(ctrls[1]);}}});
It'd be great to have a $controllers local injected variable accessible to the controller.
If this seems a good idea, I'm happy to implement it.
The text was updated successfully, but these errors were encountered:
It's a pain to have to use
link
to pass other directives' controllers to your own. e.g I want to use angModelController
instance with a directive that has acontroller
but nolink
.At the people are having to resort to a potentially superfluous
link
, and some nasty boiler-plate:It'd be great to have a
$controllers
local injected variable accessible to the controller.If this seems a good idea, I'm happy to implement it.
The text was updated successfully, but these errors were encountered: