1
안녕하세요 저는 Angular 2 프로젝트에서 작업 중이며 재료 모듈을 많이 사용하고 있습니다. 어떤 이유로 Stepper 모듈을 프로젝트로 가져올 수 없습니다. 그래서 endup 아래로 전체 자료 모듈을 수입 :각도 2 재질 스테퍼가 작동하지 않습니다.
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { StepperComponent } from './stepper.component';
import { MaterialModule } from '@angular/material';
@NgModule({
imports: [CommonModule, MaterialModule],
declarations: [StepperComponent],
exports: [StepperComponent]
})
export class StepperModule {}
와 나는 그것 그럼 다음과 같은 오류를 얻고있다
<mat-horizontal-stepper></mat-horizontal-stepper>
수입 테스트와 마찬가지로 아래에있는 내 HTML에 사용
polyfills.dll.js:24743 Unhandled Promise rejection: Template parse errors:
'mat-horizontal-stepper' is not a known element:
1. If 'mat-horizontal-stepper' is an Angular component, then verify that it is part of this module.
2. If 'mat-horizontal-stepper' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("[ERROR ->]<mat-horizontal-stepper></mat-horizontal-stepper>"): [email protected]:0 ; Zone: <root> ; Task: Promise.then ; Value:
많은 재료 모듈을 사용할 수 있습니다. 이 문제 만 있습니다. 어떤 생각이야? 미리 감사드립니다.
app.module.ts 코드를 게시하십시오. StepperComponent에서를 사용하고 있습니까? –
네, 내 질문에 언급 한''사용하고 있습니다. 'StepperModule'이 머티리얼 모듈을 임포트하고 있기 때문에'app.module.ts '와 아무런 관련이 없습니다. –
chewi
스테퍼 구성 요소는'2.0.0-beta.11'에서 도입되어 'MaterialModule'에 대한 지원을 종료했습니다. ** (변경 내역을 읽었습니까?) ** – Edric