I am struggling to find any information in relation to the steps required to get a 3rd party library to work.
Specifically, I am talking about 3rd party library that is in .js file that provides simple functionality such as some data manipulation
When clicked on the official angular cli 3rd party installation guide link, it just direct you to the home page of angular cli github page which doesn't help.
For example, using FileSaver as an example, this is how I got it to work with a hack way
npm install filesaver.js
change the folder name to filesaver instead of filesave.js because IDE does think it is a file
Create a new file under node_modules/@types/filesaver/index.d.ts and comment out everything and put in
declare module 'filesaver' { var saveAs: any; export = saveAs; }
As this frame work is outdated I had to hack it this way
- import * as fireSaver from 'filesaver'
There is a problem with this approach. I shouldn't be modifying what is inside node Module as the content will disappear if I run npm install on a new project. I should be able to create my d.ts file in the src folder and somehow use it.
Also I dont think d.ts is mandatory to get the app to work. However, without modifying this d.ts file I could not get the app to work. Weird?
This all seems messy and I can't find any information in relation on how to get a simple js file going.
Even Angular Cli 3rd party offical is outdated and talks about system js.