无法绑定到树,因为它不是树的已知属性

时间:2018-04-06 14:22:04

标签: tree angular5

我正在尝试使用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#' }]
            }
        ]
    };

我在这个网站上尝试过几个例子,但没有运气:

https://github.com/angular-ui-tree/angular-ui-tree

0 个答案:

没有答案