我正在尝试使用 PrimeNG 2.0.5 和 Angular 4 构建动态 DataTable,但出现错误:“GET http://localhost:3000/application-detail.component.html 404(未找到)”和“未处理的承诺拒绝:无法加载 application-detail.component.html ;区域:;任务:Promise.then ;值:无法加载 application-detail.component.html 未定义" ....提前致谢
这是我的代码:
app.detail.component.html ===>
<p-dataTable [value]="users" routerLink="my-dashboard">
<p-column *ngFor="let user of userService.users | async" [field]="users.status" [header]="user.data.apps.details[2].state"></p-column>
<p-column *ngFor="let user of userService.users | async" header="Type">{{user.status}}</p-column>
<p-column *ngFor="let user of userService.users | async" header="Etat">{{user.data.apps.details[2].state}}</p-column>
<p-column *ngFor="let user of userService.users | async" header="Depuis">{{user.data.apps.details[2].since}}</p-column>
</p-dataTable>
这是我的 Observable:用户:Observable
app.detail.component.ts ===>
import { Component, OnInit } from '@angular/core';
import {DataTableModule,SharedModule} from 'primeng/primeng';
import { UserService } from './user.service';
@Component({
selector: 'app-detail',
templateUrl: 'application-detail.component.html',
styleUrls: ['application-detail.component.css'],
})
export class AppDetailComponent {
constructor(public userService: UserService) { }
}