michaelbromley / michaelbromley/angularUtils
Can't use ng-transclude inside dir-paginate
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 842
- PR merge metrics
- No merged PRs in 30d
Description
I have a directive with an isolate scope that uses `dir-paginate`:
```
function myListDirective() {
return {
restrict: 'E',
replace: true,
scope: { list: '=', ... },
templateUrl: 'path/to/template/my_list.html',
controller: function() { ... },
controllerAs: 'myListDirectiveController',
bindToController: true,
transclude: true
};
}
```
where `my_list.html` is like:
```
-
...
...
```
I would like to use this directive like:
```
{{ item.name }}
// where item is from the `dir-paginate` used above```
where:
```
people = [
{name: 'Joe Smith'},
{name: 'Jane Doe'},
...
]
```
However, this gives the following error and nothing shows up in the `ng-transclude` element: "_Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: ``_".
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the myListDirective definition and its my_list.html template, then reproduce the interaction between dir-paginate and ng-transclude using the issue's example. Read the relevant AngularJS transclusion behavior and dir-paginate entry points; done means the transcluded item content renders without the reported illegal-use error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angularjs, javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100