【发布时间】:2019-09-26 23:37:17
【问题描述】:
这是我的相关代码:
import { DataTable } from 'primeng/primeng';
@Component({
moduleId: module.id,
templateUrl: 'search.component.html'
})
export class SearchComponent {
@ViewChild(DataTable)
private dataTable: DataTable;
ngAfterViewInit () {
if (this.dataTable) {
console.log("detected");
}
else {
console.log("not detected");
}
}
}
我正在尝试拿起我的p-table 组件。
关于未检测到p-table 的原因有什么想法吗?
显然,p-table 指令存在于模板中。
【问题讨论】:
标签: angular typescript primeng