ng-feathers icon indicating copy to clipboard operation
ng-feathers copied to clipboard

error after compile

Open GlauberF opened this issue 7 years ago • 6 comments

After compiling this giving error in the provider

captura de tela de 2018-04-26 09-37-28

and the error ocore in your file, for some reason

GlauberF avatar Apr 26 '18 12:04 GlauberF

Well, looks like angular is not available, when trying to register the ng-feathers provider. Do you have a chance to change the order of your script execution?

beevelop avatar Apr 26 '18 12:04 beevelop

is being stuck before the bower, including angularjs

GlauberF avatar Apr 26 '18 13:04 GlauberF

Sorry, I didn't get that. In what way is Bower involved in your execution order? Can you show me the Snippet of your html embeds?

beevelop avatar Apr 26 '18 14:04 beevelop

It's something nno your provider, because I changed the code to factory and it worked 100%

angular
  .module('ngFeathers', [])
  .factory('$feathers', function() {
    var endpoint = urlAPIAuxiliarNode;
    var socketOpts = null;
    var useSocket = true;
    var authStorage = window.localStorage;

    var app = feathers()
    // .configure(feathers.hooks())

    if (useSocket) {
      app.socket = io(endpoint, socketOpts)
      app.configure(feathers.socketio(app.socket))
    } else {
      app.configure(feathers.rest(endpoint).jquery(window.jQuery))
    }

    app.configure(feathers.authentication({
      storage: authStorage
    }))

    return app     

      
  });

GlauberF avatar Apr 26 '18 14:04 GlauberF

This doesn't make that much sense. I never experienced that kind of behaviour. What version of AngularJS are you using? And do you have some special libraries in place, which might mess around with the Angular internals?

beevelop avatar Apr 26 '18 16:04 beevelop

My libraries are normal and nothing that would affect this. My angularjs version: "angular": "1.6.9"

GlauberF avatar Apr 26 '18 19:04 GlauberF