2017-10-05 7 views
0

여러 모듈에서 PrimeNg 참조를 호출하는 데 문제가 있습니까? 아니면 공유 모듈에 있어야합니까? 거기에 모범 사례가 있습니까? primeng에서 "p-dataTable"을 가져 오지 못하고있는 것 같지만 구성 요소가 선언 된 모듈에서 가져 왔습니다.각도 모듈로 올바르게 가져 오는 방법은 무엇입니까? 내가 누락 된 부분을 알아낼 수 없다.

내가 validation.component.html 내 HTML 참조 무엇입니까 오류 :

errors.ts:42 ERROR Error: Uncaught (in promise): Error: Template parse errors: 
Can't bind to 'value' since it isn't a known property of 'p-dataTable'. 
1. If 'p-dataTable' is an Angular component and it has 'value' input, then verify that it is part of this module. 
2. If 'p-dataTable' 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. (" 
<body> 
    <h3>Validation tabs go here.</h3> 
    <p-dataTable [ERROR ->][value]="validationsList" selectionMode="single" [(selection)]="selectedValidation" dataKey="id" 
    "): ng:///app/validation/[email protected]:17 

내가 validation.module.ts

import { NgModule } from '@angular/core'; 
import { RouterModule } from '@angular/router'; 
import { SharedModule } from "../shared/shared.module"; 
import { ValidationComponent } from "./validation.component"; 
import { SampleIdsTableComponent } from "./sampleIdsTable.component"; 
import { AllTestsComponent } from "./allTests.component"; 
import { RunStatusComponent } from "./runStatus.component"; 
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; 
import { NglModule } from 'ng-lightning/ng-lightning'; 
import { 
SharedModule as Prime_SharedModule, 
TabMenuModule, AccordionModule, MenuModule, MenubarModule,  SelectButtonModule, 
CalendarModule, InputTextareaModule, DataTableModule, ChartModule, DataGridModule 
} from 'primeng/primeng'; 

@NgModule({ 
imports: [ 
    SharedModule, 
    RouterModule.forChild([ 
     { 
      path: '', 
      component: ValidationComponent, 
      children: [ 
       { 
        path: '', 
        pathMatch: 'full' 
       }, 
       { 
        path: 'samples', 
        component: SampleIdsTableComponent 
       }, 
       { 
        path: 'allTests', 
        component: AllTestsComponent 
       }, 
       { 
        path: 'runStatus', 
        component: RunStatusComponent 
       } 
      ] 

     }, 
     Prime_SharedModule, 
     TabMenuModule, 
     NgbModule.forRoot(), 
     NglModule.forRoot(), 
     AccordionModule, 
     DataTableModule, 
     MenuModule, 
     MenubarModule, 
     SelectButtonModule, 
     CalendarModule, 
     ChartModule, 
     InputTextareaModule, 
     DataGridModule 
    ]) 
], 
declarations: [ 
    ValidationComponent, 
    SampleIdsTableComponent, 
    AllTestsComponent, 
    RunStatusComponent 
], 
providers: [ 
] 
}) 
export class ValidationModule { } 

답변

0

브래킷을! 대괄호를 셉니다. imports 배열 대신 RouterModule.forChild ([...])에 모든 가져 오기를 추가했습니다.