运行And Build项目时在Angular中出现错误d3-ng2-service

时间:2018-10-15 12:01:49

标签: javascript angular d3.js

当我运行项目或构建时,它会引发错误。 我正在使用d3-ng2-service

enter image description here

  

node_modules / d3-ng2-service / index.d.ts(2,65)中的错误:错误TS2305:   模组   ““ C:/ project / myapp-d3 / node_modules / d3-ng2-service / src / bundle-d3”具有   没有导出的成员'ThresholdArrayGenerator'。

另外还有一种跳过此错误并构建项目的方法吗?

app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { D3Service , D3} from 'd3-ng2-service';
import {FormsModule} from '@angular/forms';
import { CommonModule } from '@angular/common';

import { AppComponent } from './app.component';
import { from } from 'rxjs';


@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule
],
providers: [D3Service],
bootstrap: [AppComponent]
})
export class AppModule { }

app.components.ts

import {Component, OnInit} from '@angular/core';
import {D3, D3Service} from 'd3-ng2-service';
import * as d3 from 'd3';




@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent{
  d3: D3;

  constructor(d3service: D3Service) {
    this.d3 = d3service.getD3();
  }
}

运行

enter image description here

d3-ng2-service / index.d.ts

enter image description here

0 个答案:

没有答案