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
Proposal: Host Projection #7297
Comments
Cannot this use case be solved by |
Although it would be possible to do using a template, a native core solution would be better and perform better. |
I see. But I think we need something marker like e.g.
|
A fundemental problem of this proposal is where should binding and styling go? For example:
It is not cleare whether the The goal of this discussion is to allow wrapping an underlying element in a decorating component. A better way to think about it is:
With the above wrap around approach it is clear what goes where and which binding should be applied. The downside is that it is wordy. Our approach should be to take the correct behavior and simplify the wordiness. I suggest merging the two and using the Therefore:
is short for:
And no new concepts have to be created. Advantagas are:
There is a requirement that the
Because the |
So I had a look at the initial and latest proposals and here are some thoughts. To start with I feel like we are trying to drive change in the framework based on just one use-case. If you ask me I can't think of a use-case other than inputs for the "host projection" future. And we all know that designing API on just one use case is doomed to fail :-) So if anyone has different use-cases that would benefit from the mechanism discussed here it would be great to discuss those use-cases together. Then, I completely agree with @mhevery that the initial proposal doesn't make it clear which attributes / bindings / event handlers go where. If I write <md-input class="standard-spacing">
<input class="my-class" (click)="window.alert(value)" [placeholder]="'First Name'">
</md-input> is much better since it makes it clear what belongs where. At the same time it introduces new questions:
So the new proposal makes certain things clearer and other things more confusing now. Based on this I would do more "soul searching" before implementing anything. The last remark is about the proposed At this point I'm not sure what the final solution for the "inputs case" should be but I think that it requires more thought before we can implement things. |
Based on the discussion in this issue and chat I had with Jeremy / Misko we are not going to implement host projection as described here for now. The reasoning being:
Subscribing to events / binding to properties on |
@pkozlowski-opensource @mhevery @hansl One specific example that comes to mind is forms integration. The new forms directives are not platform directives, so it seems like integration with forms would require a dependency on forms from md-input to get access to Sorry if I am missing missing something here, but with the current approach, what is the suggested integration strategy with forms from md-input? Forms seems like a very common use case for md-input. |
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. |
Design: https://docs.google.com/document/d/1E_C9Dz9IyVRgeWmPu2RwTohoLREup9dkPDvL31ruZr0
Just copying the API here for ease of discussion:
app.ts:
component.ts:
Resulting DOM:
The text was updated successfully, but these errors were encountered: