btford / btford/angular-socket-io

Best way to provide a socket URL as a parameter to the socketFactory

Open
#142 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.5k
Forks
225
PR merge metrics
No merged PRs in 30d

Description

Hi!
Not really an issue but a question :)

Since I had the same 404 issues in my console with the example code, I've tried the solution provided here and it works great : #82

``` php
...
.factory('mySocket', function (socketFactory) {
return socketFactory({
ioSocket: io('http://XX.XX.XX.XX:12345') // Local ENV
// ioSocket: io('http://YY.YY.YY.YY:9000') // Staging
});
});
```

My problem: I need to switch between URLs when I deploy my app and it's painful if I have to do it manually in the app.js file everytime...

Question: How can I make this URL become a parameter of my Angular app? If I use ng-init to define this value, how can I use it in the socketFactory?

Thanks for your help!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.