angular-sails-bind icon indicating copy to clipboard operation
angular-sails-bind copied to clipboard

Error: io.socket is undefined

Open peazz opened this issue 10 years ago • 5 comments

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?

peazz avatar Oct 05 '14 23:10 peazz

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

rshewade avatar Dec 06 '14 13:12 rshewade

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

eamador avatar Jan 18 '15 19:01 eamador

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.

peazz avatar Feb 19 '15 18:02 peazz

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.

diegopamio avatar May 04 '15 14:05 diegopamio

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

yura415 avatar Oct 01 '15 11:10 yura415