<p-dataTable [value]="services" [paginator]="true" expandableRows="true" rowExpandMode="single">
...</p-dataTable>
Run Code Online (Sandbox Code Playgroud)
存在这样的一些
<ng-template let-col let-period="rowData" let-ri="rowIndex" pTemplate="body">...</ng-template>
Run Code Online (Sandbox Code Playgroud)
对于DataTable
为什么组件上的输入属性在构造函数中不可用
@Input() results: Result[];
constructor() {
console.log(this.results); // why it is not available here
}
Run Code Online (Sandbox Code Playgroud) 我在angular 2项目中遇到了这个错误:
找不到名称'Response'.
问题来自这项服务:
import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
@Injectable()
export class CartographyService {
public data;
constructor(private http: Http) {
}
getData() {
return this.http.get('http://localhost:8000/cartography')
.map((res: Response) => res.json());
}
}
Run Code Online (Sandbox Code Playgroud)