0

I need to call 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

$("#menu-toggle").click(function(e) {
    e.preventDefault();
    $("#wrapper").toggleClass("toggled");
});

function from Dashbord.component.ts file.

HDJEMAI
  • 9,436
  • 46
  • 67
  • 93
  • 8
    Using of jquery is not recommended with angular2+. – Mahi Nov 11 '18 at 13:58
  • Possible duplicate of https://stackoverflow.com/questions/44623348/angular4-how-to-call-a-function-in-a-external-js or https://stackoverflow.com/questions/47346559/how-to-call-external-java-script-function-in-angular-5 or https://stackoverflow.com/questions/51325235/call-a-function-of-external-js-file-in-angular-5-component – Mahi Nov 11 '18 at 14:37
  • Thanks now I am able to do this – Abhishek Kumar May 07 '19 at 18:49

0 Answers0