How to include an external Javascript file in the angle?

1

In my old projects I was able to take advantage of a lot of my css codes when I started to create my projects in Angular, the research knew of a file called styles.css that is inside the src folder and inside it the app folder. / p>

This part was easy, what a challenge and how to include my old javascript files

See how I linked my javascript files

<script src="assets/js/plugins.js"></script>
<script src="assets/js/main.js"></script>


<script src="assets/js/lib/chart-js/Chart.bundle.js"></script>
<script src="assets/js/dashboard.js"></script>
<script src="assets/js/widgets.js"></script>
<script src="assets/js/lib/vector-map/jquery.vmap.js"></script>
<script src="assets/js/lib/vector-map/jquery.vmap.min.js"></script>
<script src="assets/js/lib/vector-map/jquery.vmap.sampledata.js"></script>
<script src="assets/js/lib/vector-map/country/jquery.vmap.world.js"></script>

I searched my angula project and did not find a way to include them in the project, could someone kindly explain me to include them in my project?

I tried to put it like this;

<script src="js/teste.js" type="text/javascript"></script>

I placed the test.js file inside the src folder and inside the src folder I created a js folder and put it in there, but it did not resolve and generated an error in the browser console

    
asked by anonymous 16.04.2018 / 16:50

1 answer

1

One way I'm using is to take these calls and put them in the index of your angular project, and to play all the contents in the assets folder, this will make roll, there are other forms, only more laborious, especially when you have one bootstrap template ready to move to angled design 2 or higher

    
17.07.2018 / 22:43