假设我有一个由PrimeNg为Angular2提供的TreeTable.如何在代码中扩展特定节点(例如在onNodeSelect回调中)?
为了在Angular 4.1项目中使用PrimeNG,我遇到了一些问题。
这是我正在关注的文档:https : //www.primefaces.org/primeng/#/treetable
我正在测试TreeTable功能,但是UI中的输出为空。它显示没有内容的单元格,并且具有class =“ undefined”。
app.component.html:
<p-treeTable *ngIf="treeNode" [value]="treeNode">
<p-column field="id" header="ID"></p-column>
<p-column field="label" header="Label"></p-column>
</p-treeTable>
Run Code Online (Sandbox Code Playgroud)
app.module.ts:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { HttpModule } from '@angular/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { TreeTableModule, SharedModule } from 'primeng/primeng';
import { AppComponent } from './app.component';
import { CustomerTypeService } from '../app-configure/service/app.customer.type.service';
@NgModule({
declarations: [
AppComponent
],
imports: [
CommonModule,
BrowserModule,
HttpModule, …Run Code Online (Sandbox Code Playgroud)