Linked Questions
24 questions linked to/from Dynamically load external javascript file from Angular component
46 votes
4 answers
64k views
Load JS script on component level (not at startup) [duplicate]
I have lots of JS files in my project. I want to load them when particular module or component load not when the app start. How to do this? Currently, I am loading them in index.html. The other way ...
235 votes
23 answers
366k views
How to load external scripts dynamically in Angular?
I have this module which componentize the external library together with additional logic without adding the <script> tag directly into the index.html: import 'http://external.com/path/file.js' ...
67 votes
9 answers
225k views
Angular 2: import external js file into component
I'm going to import this d3gauge.js file into one of my angular2 component, memmon.component.ts file. import '../../../../js/d3gauge.js'; export class MemMonComponent { createMemGauge() { ...
5 votes
2 answers
5k views
Google Maps compatibility IE11 not working because of polyfills.js
My app website is not working fine on IE11. The website is not loading, it gives me a blank page This is the error thrown on IE11 : SCRIPT5005: String expected js (26,286) SCRIPT5022: Exception ...
0 votes
1 answer
3k views
How to load js files from Angular assets folder to specific Angular(2,4,5) component or module?
I have custom1.js, custom2.js, custom3.js JS files and load these files into Angular component1,component2,component3 respectively. I can add these files to the index.html files but Don't want to load ...
2 votes
1 answer
2k views
where to add page specific script in angular 6?
I am new to Angular(6) and I want to know where to add page specific script in angular 6, which I have placed earlier in .cshtml file? I have found many ways to include external JS file in Angular, ...
0 votes
1 answer
2k views
Angular 6 videojs-record results in runtime error
I am using Angular 6 along with videojs-record plugin. I configured following dependencies in my project. npm install --save video.js npm install --save videojs-record Later I referenced the videojs ...
0 votes
2 answers
1k views
undefined error while calling a javascript function in angular 2
Can anyone help me how to call a function from external js file inside my angular2 component. Below is my code snippet, when I am trying to load the application it is throwing App is undefined error. ...
0 votes
2 answers
1k views
How to load script file dynamically in app.component.ts(angular)?
I am working in angular2 vs typescript. In my app.component.ts file i have to load the script files on demand based current navigator language. So i have added my function like below(home.component....
1 vote
1 answer
922 views
Cannot read property 'configure' of undefined
I get the error: core.js:5882 ERROR TypeError: Cannot read property 'configure' of undefined when I implement a Hosted Session Integration for Mastercard in Angular 2. Here is my code: payment-...
0 votes
1 answer
661 views
icons are not showing in footer angular
i am new in angular , i have installed bootsrap 4.6.0 on angular 12 and the bootsrap worked fine and the footer section appeared like it should appear except one little thing , the icons are refusing ...
1 vote
1 answer
1k views
Proper way to add widget scripts in Angular 5
I'm building an Angular 5 app and I'm trying to add a widget to one of the components. I try adding it like the answer in this question, but it fails to load some times, I don't know why. The widget ...
0 votes
1 answer
854 views
How to load External JS and CSS files into Angular 5 (files loading with delay)
As title suggested I am facing some issues while trying to import the external js and css files into Angular 5 Application. Here is code snippet that I did tried till now Component.ts : ngOnInit() { ...
1 vote
1 answer
1k views
Adding external JS script with defer attribute to Angular 11 project
I would like to use an external JS library into my Angular 11 project created using the Angular-CLI. From many answers (1, 2, 3), I see that one way to achieve this is by adding the path to the JS ...
0 votes
0 answers
611 views
Angular 2: jquery's getScript vs. HttpClient get + eval
We have an Angular 2 Project, where we try not to have any jquery dependency. BUT, we somehow have to load a script and run that. Until now this is the only place where we used jquery's getScript. ...