Search code examples
jsonangulartypescriptxml-parsingangular2-services

'xdom is not defined' error within autopulous-xdom2jso


I have imported below packages in my service, which I use for SOAP-API processing.

"autopulous-xdom": "~0.0.12"
"autopulous-xdom2jso": "^0.0.12"

I am trying to use these with below lines at top of my service.ts

import 'autopulous-xdom/xdom.js';
import 'autopulous-xdom2jso/xdom2jso.js';

import convert = xdom2jso.convert;
import {Injectable} from '@angular/core';

@Injectable()
export class SoapService {
    constructor() {}
}

I get no errors on compiling and building. But while running the application in browser, I get below error.

enter image description here

Has anyone worked with xdom2jso and xdom? Please help.


Solution

  • I got no responses and all I could do was fork and raise a PR myself into autopulous-xdom2jso.

    See my fix here: https://github.com/autopulous/xdom2jso/pull/2