Reputation: 244
I have a library which has a function structure like this..
$.fn.et_menu = function ( options ) {
var settings = $.extend({
type: "default", // can be columns, default, mega, combined
animTime: 250,
openByClick: true,
delayTime: 0
}, options );
which should be called like
$('.menu.side-menu').et_menu({
type: "default",
delayTime: 0
});
Any help.. how to integrate this in Angular..
Ive included the library in my index.html file and did
declare var et_menu: any;
in my component.ts file..
Any help would be rally greatful.
Upvotes: 0
Views: 855
Reputation: 19622
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
Step two
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")
Take a look @ this link. It has a working example and a question for the same with typings and without it.
Upvotes: 2