我试图这样在我的.ts文件中导入“ anychart”:
import 'anychart';
当我添加这一行时,我在localhost服务中的所有HTML页面都会被删除。
我的.ts文件:
import { Component, OnInit } from '@angular/core';
import { GetDataService } from '../../services/get-data.service';
import 'anychart';
@Component({
selector: 'app-venn',
templateUrl: './venn.component.html',
styleUrls: ['./venn.component.css']
})
export class VennComponent implements OnInit {
//chart: anychart.charts.Venn;
pizza3Field = [];
constructor(
private getDataService: GetDataService,
) { }
ngOnInit(): void {
this.getDataService.sendGetRequest().subscribe((data: any[]) => {
this.pizza3Field = data;
})
}
}
我的HTML文件:
<p>venn works!</p>
有人遇到这个问题或类似问题吗?