0
Ich habe 3rd-Party-js geladener Datei in app.component wie dieseLaden 3rd-Party-JS-Dateien in Winkelkomponenten Dateien
declare var MarvinJS: any;
import { MarvinJS } from "../assets/js/marvinjslauncher.js";
kann ich Methoden verwenden, die in dem marvinjslauncher.js in meiner app Komponentenklasse definiert sind, Wenn ja, bitte führe mich, wie man benutzt? Ich habe versucht, wie folgt zu verwenden:
Wenn die Art, die ich importiere, falsch ist, können Sie mich bitte auch das führen. Und ich habe auch marvinjslauncher.js in index.itml Datei erhalte ich diese Art von Fehlern:
ERROR TypeError: Cannot read property 'MarvinJSUtil' of undefined
at new AppComponent (eval at <anonymous> (bundle.js:1312), <anonymous>:16:39)
at createClass (eval at <anonymous> (bundle.js:321), <anonymous>:11007:26)
at createDirectiveInstance (eval at <anonymous> (bundle.js:321), <anonymous>:10841:37)
at createViewNodes (eval at <anonymous> (bundle.js:321), <anonymous>:12204:49)
at createRootView (eval at <anonymous> (bundle.js:321), <anonymous>:12109:5)
at callWithDebugContext (eval at <anonymous> (bundle.js:321), <anonymous>:13247:42)
at Object.debugCreateRootView [as createRootView] (eval at <anonymous> (bundle.js:321), <anonymous>:12707:12)
at ComponentFactory_.create (eval at <anonymous> (bundle.js:321), <anonymous>:10030:46)
at ComponentFactoryBoundToModule.create (eval at <anonymous> (bundle.js:321), <anonymous>:3633:29)
at ApplicationRef_.bootstrap (eval at <anonymous> (bundle.js:321), <anonymous>:5214:57)
zufällig Winkel cli mit? Der Import funktioniert nicht, wenn MarvinJS kein ES-Modul ist. Sie müssen es über ein '