我已将我的 angular 7 应用程序迁移到 8.0.0,我现在正在尝试新的编译器 ivy。
该应用程序在没有常春藤的情况下可以完美运行,但是当我尝试使用它进行编译时,出现以下错误:
不能将@Input 装饰器与查询装饰器结合使用
没有行号,没有文件,什么都没有......很难调试任何东西。
在那之前我有警告,但我不知道它是否相关:
入口点“angular-tree-component”中的警告包含对“lodash/defaultsDeep”、“lodash/get”、“lodash/omit”、“lodash/isNumber”、“lodash/first”、“lodash/last”的深度导入, 'lodash/some', 'lodash/every', 'lodash/compact', 'lodash/find', 'lodash/isString', 'lodash/isFunction', 'lodash/throttle', 'lodash/includes', '洛达什/挑选'。这可能不是问题,但可能会导致入口点的编译出现乱序。
有任何想法吗 ?
我需要帮助将路线添加到角度树。
HTML代码:
<mat-tree [dataSource]="dataSource" class="tree-container" [treeControl]="treeControl">
<mat-tree-node class="btnLinks" *matTreeNodeDef="let node" matTreeNodePadding>
<button mat-icon-button disabled></button>
{{node.name}}
</mat-tree-node>
<mat-tree-node class="btnLinks" *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding>
<button mat-icon-button matTreeNodeToggle
[attr.aria-label]="'toggle ' + node.name">
<mat-icon class="mat-icon-rtl-mirror">
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
</mat-icon>
</button>
{{node.name}}
</mat-tree-node>
</mat-tree>
Run Code Online (Sandbox Code Playgroud)
.Ts 文件
interface ProfileList {
name: string;
children?: ProfileList[];
}
const PROFILE_DATA: ProfileList[] = [
{
name: 'General',
},
{
name: 'Degrees',
},
];
/** Flat node with expandable and level information */
interface TreeFlatNode {
expandable: boolean;
name: …Run Code Online (Sandbox Code Playgroud) 我安装并导入了 angular tree 组件,并尝试使用按照https://angular2-tree.readme.io/ 中的步骤提供的基本示例进行设置
但不幸的是,我只看到根节点而没有展开。如果有任何问题,发布代码有人可以立即查看吗?请帮助我理解我显然无法看到的错误。
模块:
import { NgModule } from '@angular/core';
import { TreeModule } from 'angular-tree-component';
@NgModule({
imports: [
TreeModule
],
declarations: [],
providers: []
})
export class CourseCreationModule { }
Run Code Online (Sandbox Code Playgroud)
成分:
import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute, Params } from '@angular/router';
@Component({
selector: 'app-container',
templateUrl: './container.component.html',
styleUrls: ['./container.component.css']
})
export class ContainerComponent implements OnInit {
tree: any;
constructor() { }
getCourseDetails() {
this.createLessonTree();
}
createLessonTree() {
this.tree = [ …Run Code Online (Sandbox Code Playgroud) 我在项目中使用Angular Tree 组件,在过去的几天里,我在构建 Angular 应用程序时遇到以下错误。经过一番平静的斗争,问题得到了解决。我在下面为社区发布我的答案。
2020-09-02T13:10:19.5809754Z ERROR in node_modules/angular-tree-component/dist/components/tree-viewport.component.d.ts(3,10): error TS2305: Module '"D:/eb/A3322/work/2/s/node_modules/@types/lodash/index"' has no exported member 'Cancelable'.
2020-09-02T13:10:19.5810790Z
2020-09-02T13:10:19.7050898Z npm ERR! code ELIFECYCLE
2020-09-02T13:10:19.7053154Z npm ERR! errno 1
Run Code Online (Sandbox Code Playgroud)