Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upDI/Discuss: Allow providers to be injected based on the final ng-content transclusion point #5126
Comments
|
@jelbourn who possibly has run into this problem? Maybe :) |
|
Assigning @vsavkin to provide comments. I have yet to form an opinion about it. On one hand, |
|
Angular has thrown native shadow DOM out anyway, so I don't feel strongly about keeping browser contracts |
|
It's not thrown away but disabled by default. On Thu, Nov 5, 2015, 9:53 AM Matan Lurey notifications@github.com wrote:
|
|
Since I am not sure how frequent this use case is, I am reluctant to mix the DI and ng-content concerns. It can make DI a lot more complicated. What about this way of doing it?
This pattern requires an extra level of indirection, but keeps both DI and ng-content simple |
|
What if the I think this is a decent work around/pattern, but could fail if you have the following logic: <!-- The <tabs> component won't be created right away, but <tab> will be. -->
<tabs *ng-if="isLoading">
<ng-content select="tab"></ng-content>
</tabs> |
|
Same issue while upgarding ng1 app to ng2 with menu component. Any chances to get a solution soon? plnkr with example http://plnkr.co/edit/p7Vd4FRpHPRtyEuL6pEZ |
|
This cause to this issue: formControlName could not be used with component transclusion |
|
@matanlurey Is the issue relevant? |
Problem
Had a nice discussion with @tbosch and @yjbanov this AM.
Assume you have the following component, say
Tabs:Today, the following works:
However, what if you want to build a bigger, composite widget and use delegating?
In this case, the code will fail!😢
<tab>is transcluded finally into<tabs>, but does not have knowledge or a way to interact using theTabManagerinterface. This hurts making composable/re-usable componentsSuggestions
@IgorMinar @vsavkin