md-input-container not recognizing mdInput
Bug, feature request, or proposal:
Bug
What is the expected behavior?
md-input-container recognizes the child input element
What is the current behavior?
error is being thrown on load, stating md-input-container must contain an md-input directive
What are the steps to reproduce?
Providing a Plunker (or similar) is the best way to get the team to see your issue. Plunker template: http://plnkr.co/edit/o077B6uEiiIgkC0S06dd
I have tested this in Plunker with the provided template above and was successful at adding an input. Doing so the exact same way in our application produces the md-input-container must contain an md-input directive error on one specific component. Implementation in other parts of the application seem to be working fine. Could there be some issue with the order in which the library is being loaded in relation to the components utilizing md-input?
Unfortunately I am unable to post our code anywhere. I have tried all the different variations of the directive (md-input, mdInput, etc)
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, browsers are affected?
Is there anything else we should know?
The following are the versions I am running: "@angular/common": "2.4.4", "@angular/compiler": "2.4.4", "@angular/compiler-cli": "2.4.4", "@angular/core": "^2.4.4", "@angular/forms": "2.4.4", "@angular/http": "2.4.4", "@angular/material": "^2.0.0-beta.1", "@angular/platform-browser": "2.4.4", "@angular/platform-browser-dynamic": "2.4.4", "@angular/router": "3.4.4"
@jasonhodges, i think they are tracking this and the fix is in next release (maybe?)
just use <input md-input> for now
https://github.com/angular/material2/issues/2529
I have tried all the different variations of the directive (md-input, mdInput, etc)
@wyers As I mentioned, I have tried this
@jasonhodges Since you are not able to share a Plunker or some code, can you try sharing some similar code here?
e.g
<md-input-container>
<input mdInput placeholder="Test">
</md-input-container>
@DevVersion This is how I have it implemented:
<md-list-item>
<md-input-container>
<input md-input
placeholder="Description"
type="text"
name="description"
[formControl]="formGroup.get('description')"
[ngModel]="model.description"
(blur)="persistChange({description: $event.target.value})">
</md-input-container>
</md-list-item>
Thanks. While looking at it, it looks valid as for the beta.1 release.
If you can share the exact error from the browser console, that would be perfect!
Thanks @DevVersion , here you go

Hm, since everything works in the Plunker template I'm thinking about something in your build process that might modify the HTML attributes? (e.g html-min)
Is your application being compiled with such tools?
@DevVersion I apologize, not sure why this weird instance happened but after shutting everything down, and launching a fresh build the issue is no longer present. I suspect some leftovers were being served. Thanks for your quick responses
@jasonhodges No problem. Glad everything works now :)
inline template:13:32 caused by: md-input-container must contain an mdInput directive. Did you forget to add mdInput to the native input or textarea element? ; Zone: angular ; Task: Promise.then ; Value: e undefined app.moudle.ts import { MaterialModule,MdInputModule } from '@angular/material';
imports: [ FormsModule, routing, ExportAllService, CustomFormsModule, ReactiveFormsModule, PaginationModule.forRoot(), AccordionModule.forRoot(), ToastModule.forRoot(), ModalModule.forRoot(), MaterialModule.forRoot(), MdInputModule, UniversalModule, ],
Doesn't work for me
@ponmani On the latest release of Angular Material 2 (2.0.0-beta.2), it has changed to mdInput.
<md-input-container>
<input mdInput placeholder="Text here">
</md-input-container>
@Chan4077 You have mentioned code used. But i am using .Net core app.
If i anything write in type script of this piece of code
<md-input-container>
<input mdInput placeholder="Text here">
</md-input-container>
@Chan4077 Any update for this.
@ponmani Maybe try importing just MaterialModule?
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.