total.js - POST request in Angularjs -


I'm new to Totaljs. I wrote a code that tried to make a PUUT request with an angular factory with the user Does:

  app.factory ('user', function ($ resource) {return $ resource ('/ register', empty), {register: {method: 'post'}} )}};  

In my angle controller, when I click on the register button this method is turned on:

  $ scope.register = function () { $ Scope.user = new user ({email: $ scope.email, password: $ scope.password}); . $ Scope.user $ register (); }  

After clicking on the register button, I found this in the console:

Failed to load the resource: The network connection was lost.

This is my total JC controller:

  exports.install = function {framework.route ('/ register', registerPage); Framework.route ('/ register /', register, ['post']); }; Function register page () {var self = this; Self.view ('registerPage')} function register () {var self = this; Console.log ("run") / To add new user instead, I will only return an existing user to the current user = 'model' ('user'). Schema user FIDID (function (er, docs) {self.json (docs);}); }  

When I try it with jQuery $ .jax it works fine! So what's the problem? Thank you

I ask my questions with Peter Syr, he mails this answer:

Hello, that's fine I found a problem in the path:

Settings. Root ('/ register', register, ['put', 'jason']);


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -