You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TemplateRef shares context between instances when none is provided #10045
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior angular/modules/@angular/core/src/linker/template_ref.ts currently uses a single object for EMPTY_CONTEXT. The problem is when ViewContainerRef #createEmbededView is called without providing a context object the shared one is used causing pollution between all instances utilizing the context.
Expected/desired behavior
Object sharing doesn't happen between instances relying on the context.
Maybe some solutions could be:
TemplateRef_<C> instantiates a new object when none is provided
ViewContainerRef #createEmbededView makes context mandatory and TemplateRef_<C> stops checking isBlank of context.
Reproduction of the problem
If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).
Activity
vicb commentedon Jul 14, 2016
Please try to simplify your plunker with the minimal amount of code required to reproduce the issue.
justindoherty commentedon Jul 15, 2016
Here's the new plunk, I hope it's simplified enough.
http://plnkr.co/edit/CQQembTFT0nOxGwCzSgc?p=preview
fix(linker): prevent pollution of empty embeddedView context (#10548)
angular-automatic-lock-bot commentedon Sep 9, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.