Closed
Description
I"m using the ui-scroll in its simplest form -
<div ui-scroll="item in datasource" adapter="listCtrl.adapter">
<div ng-bind="::item.name"></div>
</div>
The problem I'm facing here is the adapter
instance is not getting injected into the right scope/controller. listCtrl.adapter
remains undefined
.
- I tried changing the
adapter
attribute toadapter on listCtrl
. It complains saying -Failed to locate target controller 'listCtrl' to inject 'adapter'
. - I set
adapter="adapter". This injected the adapter instance into
$scope.$parent` (this is probably as expected).
Looking at the code in ui-scoll.js (lines 517 - 524) -
while (candidate.length) {
let controller = candidate.attr('ng-controller');
if (controller === controllerName) {
scope = candidate.scope();
break;
}
candidate = candidate.parent();
}
Without specifying ng-controller
explicitly it looks like the injection doesn't work as expected.
Metadata
Metadata
Assignees
Labels
No labels