A
A
Andrey Kharitonov2019-11-18 07:37:26
Angular
Andrey Kharitonov, 2019-11-18 07:37:26

How to attach an external JS file to a specific Angular component and access its methods?

If the JS file is in the local folder, then there is no problem. But if you're remote, it doesn't work.
I tried to connect files through the service - the code works, but Lint gives errors.

ngOnInit() {
   this.myService.loadJS('myRemoteJsFileName').then(data => {   
   methodInRemoteJsFile();  // здесь ошибка.   проект не соберётся 
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question