This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Combination of transclude, templateUrl, require produces "Error: [$compile:ctreq] Controller 'foo', required by directive 'blubb', can't be found!" #14768
Labels
Milestone
Comments
Seems similar to #14765 (but I'm not sure). |
@gkalpak Was going to tinker with this later since I've had to work around this in my own code. The gist of the problem is that the "fallback" content isn't handled correctly.
That all goes away if it's made terminal and manually calls |
dcherman
added a commit
to dcherman/angular.js
that referenced
this issue
Jun 14, 2016
If the transclude function did not return content, then the transcluded scope that was created needs to be cleaned up in order to avoid a slight amount of unnecessary overhead since the additional scope is no longer needed. If the transcluded content did return content, the the fallback content should never have been linked in the first place as it was intended to be immediately removed. Fixes angular#14768 Fixes $14765
dcherman
added a commit
to dcherman/angular.js
that referenced
this issue
Jun 14, 2016
If the transclude function did not return content, then the transcluded scope that was created needs to be cleaned up in order to avoid a slight amount of unnecessary overhead since the additional scope is no longer needed. If the transcluded content did return content, the the fallback content should never have been linked in the first place as it was intended to be immediately removed. Fixes angular#14768 Fixes angular#14765
dcherman
added a commit
to dcherman/angular.js
that referenced
this issue
Jun 14, 2016
If the transclude function did not return content, then the transcluded scope that was created needs to be cleaned up in order to avoid a slight amount of unnecessary overhead since the additional scope is no longer needed. If the transcluded content did return content, the the fallback content should never have been linked in the first place as it was intended to be immediately removed. Fixes angular#14768 Fixes angular#14765
petebacondarwin
pushed a commit
that referenced
this issue
Jun 17, 2016
If the instance of the directive does provide transcluded content, then the fallback content should not be compiled and linked as it will never be used. If the instance of the directive does not provide transcluded content, then the transcluded scope that was created for this non-existent content is never used, so it should be destroy in order to clean up unwanted memory use and digests. Fixes #14768 Fixes #14765 Closes #14775
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Dear angular guys,
we encountered following unexpected error message while using a combination of transclude with fallback content, templateUrl, and require:
The error occurs in following situations:
The error does not show up, if no content on "bar" is provided and fallback content is used. Either it does not show up if template is provided via "template"-property and not "templateUrl"-property.
It looks like the error has no functional impact and just produces noise in the javascript console.
Reproducable: always
Browsers: Chromium 50, Firefox 46
Operating system: Linux
AngularJs: 1.5.6, 1.4.0, 1.3.0
Steps to reproduce:
You can run this: https://plnkr.co/edit/0r3IFyL8og0Wo4sGIPBW
Or use following code:
update 1:
Our expected behaviour is that if the "fallback content" from a transclude is not used there should be no lookup of required controllers from any directives from inside this discarded "fallback content".
The text was updated successfully, but these errors were encountered: