-
Notifications
You must be signed in to change notification settings - Fork 25.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgraded components with ng-transclude error if there is no transcluded content #13271
Comments
Shouldn't the label be upgrade/static? |
If you need workaround for now, you can use |
One problem that this bug has highlighted to me is that we are currently testing ngUpgrade against 1.5.x (which doesn't expose this problem) rather than 1.6.0. |
I think we need to do a better job of creating our bound transclusion function, so that it has a suitable transclusion scope passed through. |
Working on a fix for this. |
Maybe this helps: #16627 |
There are some issues with your plnkr. Here is an updated version. This still doesn't work (because of an ngUpgrade bug), but should by fixed by #16627. |
Actually, you can see that simple transclusion works already: updated plnkr
|
Previously, only simple, single-slot transclusion worked on upgraded components. This commit fixes/adds support for the following: - Multi-slot transclusion. - Using fallback content when no transclusion content is provided. - Destroy unused scope (when using fallback content). Fixes angular#11044 Fixes angular#13271
Previously, only simple, single-slot transclusion worked on upgraded components. This commit fixes/adds support for the following: - Multi-slot transclusion. - Using fallback content when no transclusion content is provided. - Destroy unused scope (when using fallback content). This commit only affects `upgrade/static`. The dynamic version will be fixed in a follow-up PR. Fixes angular#11044 Fixes angular#13271
Previously, only simple, single-slot transclusion worked on upgraded components. This commit fixes/adds support for the following: - Multi-slot transclusion. - Using fallback content when no transclusion content is provided. - Destroy unused scope (when using fallback content). This commit only affects `upgrade/static`. The dynamic version will be fixed in a follow-up PR. Fixes angular#11044 Fixes angular#13271
Previously, only simple, single-slot transclusion worked on upgraded components. This commit fixes/adds support for the following: - Multi-slot transclusion. - Using fallback content when no transclusion content is provided. - Destroy unused scope (when using fallback content). This commit only affects `upgrade/static`. The dynamic version will be fixed in a follow-up PR. Fixes angular#13271
Previously, only simple, single-slot transclusion worked on upgraded components. This commit fixes/adds support for the following: - Multi-slot transclusion. - Using fallback content when no transclusion content is provided. - Destroy unused scope (when using fallback content). This commit only affects `upgrade/static`. The dynamic version will be fixed in a follow-up PR. Fixes angular#13271
Previously, only simple, single-slot transclusion worked on upgraded components. This commit fixes/adds support for the following: - Multi-slot transclusion. - Using fallback content when no transclusion content is provided. - Destroy unused scope (when using fallback content). Fixes angular#11044 Fixes angular#13271
Previously, only simple, single-slot transclusion worked on upgraded components. This commit fixes/adds support for the following: - Multi-slot transclusion. - Using fallback content when no transclusion content is provided. - Destroy unused scope (when using fallback content). Fixes angular#13271
Previously, only simple, single-slot transclusion worked on upgraded components. This commit fixes/adds support for the following: - Multi-slot transclusion. - Using fallback content when no transclusion content is provided. - Destroy unused scope (when using fallback content). Fixes angular#13271
Previously, only simple, single-slot transclusion worked on upgraded components. This commit fixes/adds support for the following: - Multi-slot transclusion. - Using fallback content when no transclusion content is provided. - Destroy unused scope (when using fallback content). Fixes angular#13271
Previously, only simple, single-slot transclusion worked on upgraded components. This commit fixes/adds support for the following: - Multi-slot transclusion. - Using fallback content when no transclusion content is provided. - Destroy unused scope (when using fallback content). Fixes angular#13271
Previously, only simple, single-slot transclusion worked on upgraded components. This commit fixes/adds support for the following: - Multi-slot transclusion. - Using fallback content when no transclusion content is provided. - Destroy unused scope (when using fallback content). Fixes angular#13271
Previously, only simple, single-slot transclusion worked on upgraded components. This commit fixes/adds support for the following: - Multi-slot transclusion. - Using fallback content when no transclusion content is provided. - Destroy unused scope (when using fallback content). Fixes #13271
Previously, only simple, single-slot transclusion worked on upgraded components. This commit fixes/adds support for the following: - Multi-slot transclusion. - Using fallback content when no transclusion content is provided. - Destroy unused scope (when using fallback content). Fixes angular#13271
Previously, only simple, single-slot transclusion worked on upgraded components. This commit fixes/adds support for the following: - Multi-slot transclusion. - Using fallback content when no transclusion content is provided. - Destroy unused scope (when using fallback content). Fixes angular#13271
Previously, only simple, single-slot transclusion worked on upgraded components. This commit fixes/adds support for the following: - Multi-slot transclusion. - Using fallback content when no transclusion content is provided. - Destroy unused scope (when using fallback content). Fixes #13271
Previously, only simple, single-slot transclusion worked on upgraded components. This commit fixes/adds support for the following: - Multi-slot transclusion. - Using fallback content when no transclusion content is provided. - Destroy unused scope (when using fallback content). Fixes angular#13271
Previously, only simple, single-slot transclusion worked on upgraded components. This commit fixes/adds support for the following: - Multi-slot transclusion. - Using fallback content when no transclusion content is provided. - Destroy unused scope (when using fallback content). Fixes angular#13271
Previously, only simple, single-slot transclusion worked on upgraded components. This commit fixes/adds support for the following: - Multi-slot transclusion. - Using fallback content when no transclusion content is provided. - Destroy unused scope (when using fallback content). Fixes #13271
Previously, only simple, single-slot transclusion worked on upgraded components. This commit fixes/adds support for the following: - Multi-slot transclusion. - Using fallback content when no transclusion content is provided. - Destroy unused scope (when using fallback content). Fixes angular#13271
Previously, only simple, single-slot transclusion worked on upgraded components. This commit fixes/adds support for the following: - Multi-slot transclusion. - Using fallback content when no transclusion content is provided. - Destroy unused scope (when using fallback content). Fixes angular#13271
I know that this is an old issue, but this seems to be still happening with angular 5.2.4 and angularjs 1.6.9: |
@FDIM, this issue is closed as fixed. Can you please open a new issue to track the bug you are reporting? |
The function provided by `ngUpgrade` as `parentBoundTranscludeFn` when upgrading a component with transclusion, will break in AngularJS v1.5.8+ if no transclusion content is provided. The reason is that AngularJS will try to destroy the transclusion scope (which would not be needed any more). But since the transcluded content comes from Angular, not AngularJS, there is no transclusion scope to destroy. This commit fixes it by providing a dummy scope object with a no-op `$destroy()` method. See angular#13271 (comment).
@gkalpak done |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a ... (check one with "x")
Current behavior
When an upgraded ng1 component contains an ng-transclude directive, but the element is not supplied with content to transclude — e.g. it is empty, or should use fallback content — then the following error is thrown:
It seems the ng1 transclusion directive tries to destroy the transcluded scope if the transcluded content is empty, but UpgradeComponent doesn't actually supply a scope in this case.
Expected behavior
It should work without errors.
Minimal reproduction of the problem with instructions
https://plnkr.co/edit/iluIot4jXRbot4Rk3O9t?p=preview
What is the motivation / use case for changing the behavior?
Correctness, ease of upgrade.
Please tell us about your environment:
macOS Sierra
Angular version: 2.3.0-rc.0, 1.6.0-rc.2
Browser: all
Language: all
The text was updated successfully, but these errors were encountered: