Tag: yfiles

将库导入到没有NPM的Angular2 / WebPack项目中

我对Angular2和WebPack是完全陌生的,并且正在为可能非常简单的事情而苦苦挣扎。 我们正在尝试将yFiles for HTML合并到Agular2 / WebPack项目中。 我在@types/yfiles上find并在NPM上导入了types文件。 库的其余部分只能从供应商处获得,而不能在NPM上获得。 这编译正确,但是当我debugging项目时,控制台报告错误: EXCEPTION:未捕获(承诺):错误:./HomeComponent类中的错误HomeComponent – 内联模板:0:0由:未定义的yfiles 错误:./HomeComponent类中的错误HomeComponent – 内嵌模板:0:0由:yfiles未定义 它不是HomeComponent那么多的DiagramComponent它引用有问题。 import { Component, OnInit } from '@angular/core'; @Component({ selector: 'fs-diagram', templateUrl: './diagram.component.html', styleUrls: ['./diagram.component.scss'] }) export class DiagramComponent implements OnInit { private canvas: yfiles.view.CanvasComponent; constructor() { this.canvas = new yfiles.view.CanvasComponent(); } ngOnInit() { } } 文件夹结构如下所示: > root > […]