-
Notifications
You must be signed in to change notification settings - Fork 25.6k
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
Supply context to NgTemplateOutlet #8368
Comments
I'm not sure it will work, given that these are 2 different templates. ctx = { self: {} }; <template [ngTemplateOutlet]="templateRef" [ngTemplateOutletContext]="ctx"></template> <template #templateRef let-self="self">
<pre>{{self | json }}</pre>
</template> Will this work? |
This doesn't seem so easy to achieve atm, but it would be really useful 👍 |
This would be very easy to do, technically speaking - we just need to come up with an appropriate API for this. |
@pkozlowski-opensource Awesome! Looking forward to this :-) |
@shlomiassaf Your sample implementation works well... thanks! |
According to @pkozlowski-opensource the code posted on #8368 (comment) looks ok, there are couple of test cases that needs to be added(https://gitter.im/angular/angular?at=5755486d824488852c4f3cdc)
|
This was fixed in kaster via 164a091 |
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. |
Current behavior
NgTemplateOutlet
does not accept context.Expected/desired behavior
NgTemplateOutlet
has an additional@Input
that allows attaching local context toEmbeddedViewRef
Other information
After feat(core): introduce template context it is relativly easy to supply a context to the template ref
Should be something like
The text was updated successfully, but these errors were encountered: