angular-recursion icon indicating copy to clipboard operation
angular-recursion copied to clipboard

Bug when using require?

Open leblancmeneses opened this issue 9 years ago • 1 comments

require: ['dhLayers'],
controller: dh.layer.layersDirectiveCtrl,
controllerAs: 'layersCtrl',

I want to use require: ['dhLayers','^?dhLayers'], So that ctrls in link method => ctrls[0] == current layers control, ctrls[1] == parent layers control.

Instead the result I get is ctrls[0] is equal to ctrls[1] and the value represent the current directive controller.

leblancmeneses avatar Jun 19 '15 19:06 leblancmeneses

I haven't actually tried this but the problem might be:

https://github.com/angular/angular.js/blob/0d55298b56fcd67570374441c0bba76c0bf0d1f0/src/ng/compile.js#L339

  • * ?^^ - Attempt to locate the required controller by searching the element's parents, or pass
  • null to the link fn if not found.

^? searches current element and parent elements. I need only parent search.

leblancmeneses avatar Apr 21 '16 19:04 leblancmeneses