I'm trying to learn Angular 8 currently. I want to include external custom Javascript file in only specific component.html. What Configuration is need Configurations are needed for this?
Asked
Active
Viewed 124 times
0
-
Please Refer This Link https://stackoverflow.com/questions/37081943/angular2-import-external-js-file-into-component – Dixit Savaliya Aug 27 '19 at 07:50
-
i saw it but when used it code the my custom js file added as global. – გენო მუმლაძე Aug 27 '19 at 07:54
-
i want that test.js file to appear as local , in only specific component.html – გენო მუმლაძე Aug 27 '19 at 07:55
1 Answers
0
Either you use a library that you could include in your component :
npm install my-library
import * as myLibrary from 'my-library'
Or you could import your Javascript library in your angular.json file in the script section.
You can also refer to this post : How to add external js file in angular 6 library

jean-charles Bonnard
- 56
- 5
-
I was just answering,... Before being rude, you could have checked on Stack for an answer : https://stackoverflow.com/questions/48173259/import-3rd-party-javascript-libraries-in-angular-single-components – jean-charles Bonnard Aug 27 '19 at 08:13