2017-10-05 2 views
0

Gibt es ein Problem mit dem Aufruf der PrimeNg Referenzen in mehreren Modulen? Oder sollte ich es in einem geteilten Modul haben? Gibt es dort eine Best Practice? Es scheint, dass ich "p-dataTable" aus Primeng nicht importieren kann, aber ich habe es in dem Modul, wo die Komponente deklariert ist.Wie man richtig in eckige Module importiert? Kann nicht herausfinden, welches Stück ich vermisse.

Der Fehler Ich beziehe mich in validation.component.html meinem html bekommen:

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 

Ich habe 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 { } 

Antwort

0

Brackets! Zählen Sie die Klammern. Ich habe alle meine Importe zu RouterModule.forChild ([...]) anstelle des Imports-Arrays hinzugefügt.

Verwandte Themen