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
Asked
Active
Viewed 36 times
1 Answers
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.
- 5,637
- 12
- 49
- 77
Kamran Asim
- 650
- 3
- 13
-
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