Reputation: 133
I am developing an application with a sails backend and Angular 5 as the front end app.
I need to use the sails socket feature with the Angular 5 based app. I added a script tag which is
<script type="text/javascript" src="http://localhost:1337/js/dependencies/sails.io.js"></script>
But when I run the ng serv and then the console shows this error. Thanks in advance.
Upvotes: 1
Views: 844
Reputation: 8166
Create a folder js
in your Angular 5 /src/assets/
directory.
Put the sails.io.js
file in your Angular 5 /src/assets/js/
folder.
Now in your index.html
give path like follow:
<script type="text/javascript" src="assets/js/sails.io.js"></script>
It will work fine.
Upvotes: 1