2017-05-14 2 views
1

각도 응용 프로그램에서 mdl-select 구성 요소를 사용하려고합니다.재질 디자인 조명 mdl-select

Unhandled Promise rejection: Template parse errors: 
Can't bind to 'value' since it isn't a known property of 'mdl-option'. 
1. If 'mdl-option' is an Angular component and it has 'value' input, then verify that it is part of this module. 
2. If 'mdl-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. ("tiple="true" placeholder="Select users"> 
     <mdl-option mdl-ripple *ngFor="let hero of heroes" [ERROR ->][value]="hero.name">{{hero.name}}</mdl-option> 
     </mdl-select> 

"): ng:///AppModule/[email protected]:59 
+0

수입은 어떻게 생깁니 까? 이 문제가 생길 때마다 가져 오기 또는 부트 스트랩 문제가 발생했습니다. –

+0

여기의 설명과 같습니다. https://github.com/mseemann/angular2-mdl-ext/tree/master/src/components/select. 나는 select가 필요한 구성 요소에서 '@ angular-mdl/select';에서 가져온 {import {MdlSelectModule}}을 사용했습니다. – Ciprian

+0

'@ angular-mdl/option'에서'import {MdlOptionComponent} '를 시도해 볼 수 있습니까? –

답변

0

문제가 될 필요가 당신이 모듈 속성을 가져하지 않는 것입니다 : https://github.com/mseemann/angular2-mdl-ext/tree/master/src/components/select

이 콘솔 오류를 가져 오기 :

<form [formGroup]="form"> 
    <mdl-select formControlName="personId"> 
    <mdl-option *ngFor="let p of people" [value]="p.id">{{p.name}}</mdl-option> 
    </mdl-select> 
</form> 

내가 여기에서 지침을 사용하여 설치 루트에 부트 스트랩 된 app.module.ts.

맞춤 구성 요소에서 import { MdlSelectModule } from '@angular-mdl/option'을 가져 와서 app.module.ts으로 이동하십시오. 또한 imports: [] 어레이에 MdlSelectModule을 넣으십시오. app.module.ts

관련 문제