【发布时间】:2020-04-17 01:41:34
【问题描述】:
我将OpenRouteService 添加到我的 Stackbliz 应用程序中,但无法正常工作。
组件看起来像:
import { Component, OnInit } from '@angular/core';
import {Location} from '@angular/common';
import {Openrouteservice} from '/openrouteservice-js/dist/ors-js-client';
@Component({
selector: 'app-event-plan',
templateUrl: './event-plan.component.html',
styleUrls: ['./event-plan.component.scss']
})
export class EventPlanComponent implements OnInit {
constructor(private _location: Location) {
console.log("++++")
console.log(Openrouteservice)
}
ngOnInit() {
}
backClicked() {
this._location.back();
}
}
我的问题是它没有加载。我在依赖项部分将其添加为依赖项。
我在这里公开了这个项目是 url - https://stackblitz.com/edit/angular-micwge?file=src%2Fapp%2Fevent-plan%2Fevent-plan.component.ts
【问题讨论】:
-
您无法让
this._location.back();工作或无法让Openrouteservice加载?顺便说一句,你的 stackblitz 不起作用 -
我就是无法让 Openrouteservice 工作。甚至控制台日志都会抛出错误,因为导入不起作用。
-
链接现在应该可以使用了
标签: javascript angular api npm