0

I have an Angular 12 application that needs to process an XML response from a server into a JSON or JS object so that I can better manipulate the data. I had done this in the past with "xml2js" and similar libraries, but there has been a major change to Angular that causes issues with all of the JS libraries and npm packages I had used before.

For example, this posted solution does not work for me.

I have followed a number of tutorials online and tried everything short of downloading a library manually and adding it as a script in index.html.

Is there an "ng add" supported npm package that can do the parsing for me? If not, how can I take another package and add it into Angular 12 easily?

Logan Kitchen
  • 641
  • 1
  • 13
  • 25
  • The `xmljs` package is from the GitHub repo `node-xml2js` - it's not built with browsers in mind - it's just by chance that it (mostly) works in browsers. Behind the scenes in Angular it's a webpack issue - where as far as I know any node specific code is not packaged in the browser bundles – Drenai Nov 03 '21 at 22:52

0 Answers0