I had a link to the script file in index.html (root); index.html:
<script src="page1.js"></script> <script src="assets/sliderfunctions.js"></script> <script src="assets/js/custom.js"></script>
no need sliderfunctions.js here, it contains some specific functions about the slider, so I transfer it to the slider.component.html file, but, as you might imagine, it does not work, since I expected that it never loads into the browser.
slider.component.ts:
import {Component,ViewEncapsulation} from '@angular/core'; @Component({ selector:'app-slider', templateUrl:'../templates/slider.component.html' }) export class SliderComponent{ constructor(){} }
slider.component.html:
<script src="page1.js"></script> <script src="assets/sliderfunctions.js"></script> <script src="assets/js/custom.js"></script>
(I took 3 of them because the order of the scripts is important), so I want to get a specific point that I am already doing a network search, but I canβt figure out how to add the script file to the component templates
source share