It would be great if anyone provides me an example !!
Thanks in Advance!!
You need to include your JS file in the asset folder and refer this JS file in .angular-cli.json file.
Refer the snapshot’s,
Folder structure should be like this.
your TS should be like this.
myJsFile.js file content.
This sample logic mentioned above will work, I have tried and tested using version 4, So I am expecting it to work with version 5 also.
Updating the answer for the new Angular version release. Working
perfectly till version
Find the code (function with parameter) here for Angular11