0

I have .js file in my project I've created angular project as partial view,So I need to include js file in particular page, I need to call js file in angular 6 , angular.json is global declaration, So I need to include in this page only

enter image description here

Damian
  • 4,395
  • 4
  • 39
  • 67

1 Answers1

0

Do you mean to call javascript function from the User.js in user.component.ts?

You can import javascript file as import * as abc from "./User.js";

and then call your function like abc.Yourfunction();

Hopefully, it 'll work for you

George C.
  • 6,574
  • 12
  • 55
  • 80
Kamran Asim
  • 670
  • 4
  • 16
  • No, I need to call User.js file into user.html , I've called but not working for me – MATHAVAN Mar 26 '19 at 11:21
  • Can you try https://stackoverflow.com/questions/44204417/dynamically-load-external-javascript-file-from-angular-component/44276683#44276683 – Kamran Asim Mar 27 '19 at 04:17