Step one
npm install jssha --save [using jssha for this demo] It it is your own custom file place it in the scripts array of angular-cli.json skip this step 1
Second step
Add the jssha scripts file in .angular-cli.json file "scripts": [ "../node_modules/jssha/src/sha.js" ] Step three Adding a var in component to be used as a global variable //using external js modules in Angular Component declare var jsSHA: any; // place this above the component decorator shaObj:any; hash:string; this.shaObj = new jsSHA("SHA-512", "TEXT"); this.shaObj.update("This is a Test"); this.hash = this.shaObj.getHash("HEX")
Check out the @this link . It has a working example and a question for the same with and without type. I used bootstrap and jquery with Angular in this project, you can also check repo.
In your case you need to add jquery files
as in angular-cli.json
"styles": [ "../node_modules/bootstrap-v4-dev/dist/css/bootstrap.min.css", "styles.css" ], "scripts": [ "../node_modules/jquery/dist/jquery.js", "../node_modules/tether/dist/js/tether.min.js", "../node_modules/bootstrap-v4-dev/dist/js/bootstrap.min.js"
and then declare in the component. declare var $: any;
That should work.
UPDATE
I started creating a modal bootstrap using only jquery in Angular using the steps described above.
Works Check the link to the gh - LINK page.
and if you want to check the source code for the same LINK check.
The answer I wrote came by this link, this is my page on Angular LINK
source share