How to call a javascript function from typescript in Angular2?

calling a normal javascript function from a typescripit file.

Assume that i have a javascript file names test.js and i have imported this file in the index.html of the application.

Now i need to call this test() function from app.component.ts file.

function test(){ cosole.log('test'); }


Use below way 
(window as any).test()

1 comment:

  1. Great and informative article and this is very important and really worth for me and I am going to implement this program on our website, you have explained it very clearly. thanking you.

    MAKE MONEY FROM BLOG

    ReplyDelete