-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Can't bind to 'ngModel' since it isn't a known property of 'md-input'. #1335
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
Comments
You probably need to import the |
Perfect thanks. Here's the solution:
|
That's the solution!! Even it solved my work |
I currently have this same problem, but I already am including the FormsModule. To make it weirder, I only have this issue when I do |
@jrood - did you find a solution for this as I am experiencing a similar scenario as works on the development workbench, but not when I build for production. Related issue: |
Yeah in my case the html-loader was lowercasing the M in ngModel |
How could you tell it was doing that, and how did you resolve that? |
@webtechy I could tell because my error message actually said |
@webtechy In the angular 2 webpack tutorial you can see in the config/webpack.prod.js file they have a similar kind of workaround:
|
Well spotted! I'll check for that too later! |
I had the same issue. Turns of I had [([ngModle])] rather than [(ngModel)] so make sure to double check that if you are running into this issue and its not an error importing Forms Module |
I'm still having this issue:
I'm updating from RC4 -> RC5. I've added import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import {DeprecatedFormsModule} from '@angular/common';
import { FormsModule } from '@angular/forms';
import { ProductManagement } from './product_management/ProductManagement';
@NgModule({
imports: [ BrowserModule, DeprecatedFormsModule, FormsModule ], // module dependencies
declarations: [ ProductManagement ], // components and directives
bootstrap: [ ProductManagement ], // root component
providers: [] // services
})
export class AppModule { } |
I have this problem too... it blows up all the other components... |
@Neltherion If you still have this problem after including FormsModlue to your AppModule, please check if you are using any html minification tool whereas angular2 directive is case-sensitive. |
As said by @jrood, it happens only when using
|
I have this problem too... I have also import 'FormsModule' but not solve |
Any update on this issue? Any resolution? |
Try this in your webpack config. @kvuppla
|
@cdcooksey Did you ever find a solution for this? |
@zachonahill Unfortunately not. As far as I can tell so far, there isn't a fix and this issue shouldn't be closed. My team is still stuck on Angular2 RC4 due to these issues. We're investigating mounting the RC4 app inside a new Angular5 build and then migrating the code one piece at a time. Maybe @joshterrill can point us in the right direction. |
@cdcooksey Thanks for the quick reply. That's unfortunate, but good to know. Not wasting more time trying to make it work. Will look into other options |
Honestly, I stopped using manual webpack configurations a while ago in favor of the Angular CLI. I would wholeheartedly recommend switching if you can. |
@cdcooksey I haven't had this issue since I posted about the original solution I came up with, and my team hasn't tried to upgrade our application. Sorry I can't be of much more help. |
As of 12/26/2017, I've bumped into the same problem creating the new default project with Angular CLI.. After creating a new default Angular app, I get an error in Visual Studio Code on Windows 10 when I added the ngmodel. It appears the solution posted by joshterrill above seems to fix the problem. However, I am following a up-to-date Udemy Angular course by Maximilian Schwarzmüller and following his step-by-step instructions using Angular CLI seem to break the code without this fix. |
I faced the same issue as I was typing [{ngModel}] instead of [(ngModel)] |
I solved the same problem. In my case it was explicitly importing Material module into the parent module despite the fact that Material is only invoked from the child. |
Goto your app.module > |
Hello, i'm using angular 7, i already imported FormsModule in the app.module and added to the imports but it keeps giving me the same error... Anyone solved it already? |
This is a proper answer mate.Thanks Allah You save me from wasting time. |
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. |
I've seen some similar issues of people that have been getting this issue, but none of them seem to apply to the issue that I'm having as I'm using angular
2.0.1
. I cloned this project so I could get a starting point that has material2 already in it: https://github.com/jelbourn/material2-appAnd when I try to do an input that has
[(ngModel)]="something"
it gives meHere's my HTML it's blowing up on (which is on app.component.html):
And my component definition in app.component.ts
Edit: Here's my
package.json
file:And here's the
package.json
of mynode_modules/@angular/core
The text was updated successfully, but these errors were encountered: