0
私は私のコンポーネントに特定のライブラリを使用しようとしていますが、私はきちんと角度成分にtypescriptですモジュールをインポート
次のように私のコンポーネントがあり、それを含めてのステップが欠落しているように見えます。問題のライブラリはgeloibs .d.tsファイル
import { Component, OnInit } from '@angular/core';
import { StationsService } from '../../../services/stations/stations.service';
import { Station } from '../../../classes/station.model';
import 'geolib';
@Component({
selector: 'app-pollution',
templateUrl: './pollution.component.html',
styleUrls: ['./pollution.component.scss']
})
export class PollutionComponent implements OnInit {
private markers: Station[];
constructor(private stationsService: StationsService) { }
ngOnInit() {
this.stationsService.GetAll().subscribe(
res => {
for (let i of res) {
var t = geolib.computeDestinationPoint({ latitude: i.Lat, longitude: i.Long }, 1234, 90);
}
this.markers = res;
}
);
}
}
geolibある
declare namespace geolib {
.....
}
declare module "geolib" {
export = geolib;
}
ツーリングは文句はありません、すべてのコンパイルが、私は定義されていないgeolibそれを実行するときに、次のようです。
はあなたがgeolibとして「geolib」から*インポートを試してみました。 – bryan60
それはうまくいった!ありがとうございました!答えとして提出し、私はそのようにマークします。 – americanslon
完了、喜んで助けてください – bryan60