I have a javascript(.js) file with set of functions in one object.
Now i want to call a function which is (.js) file with (click)event in angular2 template. how to call?? IES.js ..........
var IES = IES|| {};
IES.execute = function (functionName, args) {
if(arguments.length>2){
args = [].slice.call(arguments).splice(1);
}
var context = IES;
var namespaces = functionName.split(".");
var func = namespaces.pop();
for(var i = 0; i < namespaces.length; i++) {
context = context[namespaces[i]];
}
return context[func].apply(context, args);
}
IES.do = function(){
console.log('In Do function');
}
IES.test = function(){
console.log('In test function');
}
IES.test.hello = function(){
console.log('In hello function');
}