Content projection into md-input-container must contain an md-input
See original GitHub issueBug, feature request, or proposal:
Bug/Feature
What is the expected behavior?
md-input-container validation should occur after content projection is applied
What is the current behavior?
The resulting content projection provides the md-input/mdInput, but the validation does not take this into account
What are the steps to reproduce?
Create a component similar to:
<md-input-container> <ng-content></ng-content> </md-input-container>
and pass an input to the component. No matter what you pass in, you always get the error
md-input-container must contain an md-input directive. Did you forget to add md-input to the native input or textarea element?
https://plnkr.co/edit/X2cKySR81BG51IbshX4m?p=preview
What is the use-case or motivation for changing an existing behavior?
It makes it particularly hard to extend the functionality of md-input-container with this
Which versions of Angular, Material, OS, browsers are affected?
Angular 4.0.0-beta.6 material 2.0.0-beta.1
Is there anything else we should know?
I was able to solve this with a directive selector =‘md-input-container’ and insert the desired content (validation messages) at runtime, but this is not nearly as clean and using content projection.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:8 (2 by maintainers)
Top GitHub Comments
@pgrm Here is what I am using until this is resolved. I have added more of our custom components to this selector and have a bit more code to work between them, but this is the jist of it.
https://plnkr.co/edit/WTVqPeWg63tBu0wOOk59?p=preview
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.