Ich brauche Hilfe bei der Einfuhr, I @ Typen verwenden/Faltblatt, das eine Art NowTyposkript Vermächtnis js lib Erweiterung Problem
export namespace Icon {
interface DefaultIconOptions extends BaseIconOptions {
imagePath?: string;
}
class Default extends Icon<DefaultIconOptions> {
static imagePath?: string;
constructor(options?: DefaultIconOptions);
}
}
definiert, würde Ich mag die folgende libreray verwenden, das das Symbol Verhalten erweitert: https://www.npmjs.com/package/leaflet-fa-markers das Problem ist, dass es schlicht JS ist und der Typ definiert ist nicht in @types ... node_modules/Faltblatt-fa-Marker/L.Icon.FontAwesome.js
L.Icon.FontAwesome = L.Icon.extend({
options: {
popupAnchor: [0, -50]
},
createIcon: function() {
var div = document.createElement('div');
...
Bisher ich habe importierte js und css in .angular-cli.json, aber c an't herauszufinden, wie es in meinem Dienst zu importieren ... Bisher habe ich die js lib
importiertimport 'leaflet-fa-markers';
//...
let marker = new L.Marker([ lat, lng], {
icon: L.icon.fontAwesome({
iconClasses: 'fa fa-info-circle', // you _could_ add other icon classes, not tested.
markerColor: '#00a9ce',
iconColor: '#FFF'
}),
draggable: true});
Aber ich den Fehler:
src/app/_services/canimap.service.ts (99,24): Property 'fontAwesome' does not exist on type '(options: IconOptions) => Icon<IconOptions>'.