Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: io.socket is undefined #20

Open
peazz opened this issue Oct 5, 2014 · 5 comments
Open

Error: io.socket is undefined #20

peazz opened this issue Oct 5, 2014 · 5 comments

Comments

@peazz
Copy link

peazz commented Oct 5, 2014

I am trying to integrate this with my angular project but as soon as I make a call inside a controller I get the following error:

 Error: io.socket is undefined
 _get@http://localhost:9000/bower_components/angular-sails-bind/angular-sails-bind.js:179:13

I have confirmed that sails.io.js is being included before angular etc etc, any ideas?

@rshewade
Copy link

rshewade commented Dec 6, 2014

I am facing the same issue too. Is there any other js file to be included like sails.io.js etc.

@eamador
Copy link

eamador commented Jan 18, 2015

Same issue here too, did you manage to fix it?

@peazz
Copy link
Author

peazz commented Feb 19, 2015

Yeah I did, you need to manually include Sails.io.js before loading Angular Sails binds, the plug in does work it just not include the required file.

@diegopamio
Copy link
Owner

Yes, sorry for the long delay in answering, I've been really busy at may day-job.

You should include sails.io.js. It gets added by default on sailjs projects. I may need to add that to the readme.

@yura415
Copy link

yura415 commented Oct 1, 2015

Hi everyone. I think that I've had experienced this issue.
Here is how scripts included:

  <script src="js/dependencies/sails.io.js"></script>
  <!-- build:js(src) scripts/vendor.js -->
  <!-- bower:js -->
......
  <script src="../bower_components/angular-sails-bind/dist/angular-sails-bind.js"></script>
.......
  <script src="../bower_components/angular-socket-io/socket.js"></script>
.......
  <!-- endbower -->
  <!-- endbuild -->

And here is my code:

  /** @ngInject */
  function DataRowsController(..., $scope, $sailsBind, ...) {
...
    $sailsBind.bind("proxy", $scope);
...
  }

If I navigate to some route that not uses sails-bind (so sails.io will connect normally) and then navigate to route that uses it -- it works OK. But if I open app at route that uses sails-bind, it will fail with error:
screen shot 2015-10-01 at 13 51 43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants