我正在尝试使用ng2-tree并遇到错误>
错误
Can't bind to 'tree' since it isn't a known property of 'tree'. ("
</tbody>
<tree [ERROR ->][tree]="tree" *ngIf="tree" >
<ng-template let-node >
<span clas"): ng:///EditFolderModule/FolderPathComponent.html@16:18
'tree' is not a known element:
1. If 'tree' is an Angular component, then verify that it is part of this module.
2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.
文件夹-path.html
<tree [tree]="folderTree" *ngIf="folderTree" >
<ng-template let-node >
<span class="node-name" [innerHTML]="node.name"></span>
</ng-template>
</tree>
文件夹-path.module.ts
public tree: TreeModel = {
value: 'Programming languages by programming paradigm',
children: [
{
value: 'Object-oriented programming',
children: [{ value: 'Java' }, { value: 'C++' }, { value: 'C#' }]
}
]
};
我在这个网站上尝试过几个例子,但没有运气: