Reputation: 1
I try to include *.js in [ *.component.html ] file
like this :
<script src="modal.js" type="text/javascript"></script>
but it doesn't load.
Only success I got , when I try to load *.js is in src/index.html.
I am a newbie at Angular2 ,I don't know how to load js flie in Angular 2 project .
any inputs?
Upvotes: 0
Views: 271
Reputation: 657098
<script>
tags in templates are not added to the DOM, they are just stripped from the template. You need to use other means to add the script. For example require()
Upvotes: 1