components icon indicating copy to clipboard operation
components copied to clipboard

md-option [value] is not part of component

Open BenoitDelrue opened this issue 9 years ago • 10 comments

Can't bind to 'value' since it isn't a known property of 'md-option' for [email protected]

The official plunker for md-select is also not working anymore : https://plnkr.co/edit/NB387exfVg0Cptr3tcZZ?p=preview

BenoitDelrue avatar Oct 11 '17 10:10 BenoitDelrue

md -> mat

benb7760 avatar Oct 11 '17 10:10 benb7760

It should be resolved if you switch to the mat- prefix. See the beta.11 changelog.

crisbeto avatar Oct 11 '17 14:10 crisbeto

When I've switched to mat-*, I still get:

zone.js?6524:196 Uncaught Error: Template parse errors: Can't bind to 'value' since it isn't a known property of 'mat-option'.

  1. If 'mat-option' is an Angular component and it has 'value' input, then verify that it is part of this module.
  2. If 'mat-option' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
  3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. (")"> Not selected <mat-option *ngFor="let report of reports" [ERROR ->][value]="report">{{report.name}}

tomchovanec avatar Oct 19 '17 11:10 tomchovanec

I also get this error.

avilao avatar Oct 24 '17 14:10 avilao

I also had that problem, I forgot to import the module 'MatSelectModule' in the app.module.ts.

afmesag avatar Oct 24 '17 21:10 afmesag

Hi, I confirm this message appear without import { MatSelectModule } from '@angular/material/select'; in app.module and MatSelectModule in import. Close the ticket

I have no a collection and use alternative syntax <mat-radio-group name="gender" [(ngModel)]="gender"> <mat-radio-button value="0"> Male </mat-radio-button> <mat-radio-button value="1"> Female </mat-radio-button> </mat-radio-group>

aldari avatar Nov 14 '17 11:11 aldari

Of course, if you're seeing the error in unit tests, you may also need to import the module in your spec.ts file, as well as app.module.ts ... and for anyone like me still using 2.0.0 beta 10 (updating existing apps seems to be quite a bit of work) the relevant module name is of course MdSelectModule.

jh3141 avatar Feb 16 '18 12:02 jh3141

i also got stuck there...u guys saved my time..thanks!!

roh1tgupta avatar Apr 28 '18 06:04 roh1tgupta

What is this not documented though? No mention on https://material.angular.io/components/select/overview ?

clement911 avatar May 14 '18 03:05 clement911

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.