How to add external javascript library to gateway project

I am trying to add a Simpl5 javascript library to my gateway unsuccessfully. I added SIPml-api.js and SIPml.js to the webapp / content / scripts folder .

In .angular-cli.json I have an array of update scripts, for example:

    "scripts": [
        "content/scripts/SIPml-api.js",
        "content/scripts/SIPml.js"
    ]

Then I try to call SIPml in the component as follows:

import { Component, OnInit } from '@angular/core';
declare var SIPml: any;

.

ngOnInit() {
    SIPml.setDebugLevel((window.localStorage && window.localStorage.getItem('org.doubango.expert.disable_debug') === 'true') ? 'error' : 'info');

}

I get ERROR ReferenceError: SIPml is not defined in the console.

Can anyone help?

+4
source share
1 answer

JHipster angular cli @GaëlMarziou, .

CLI .

, .angular-cli.json , JHipster build/serve ( package.json, ng serve/build ..). .

css js vendor.ts, , npm run serve, .

+1

Source: https://habr.com/ru/post/1684536/


All Articles