Noufal Noufal - 2 years ago 160
AngularJS Question

GET boolean response through restangular

I have created a rest service using Jersey. The service allows user to check if the username is already available or has been used by someone.


This returns true or false and it works fine.

Now in my UI I am trying to use the Restangular in Angularjs where my code is as follow

var userBaseUrl = Restangular.all('user');

var valid ='checkUname',uname).get();

But 'valid' does not have a boolean value.

All the executions are working proper as I see in the debugging.

How do I access a boolean response through Restangular ?

Answer Source

try to do this:

Restangular.all('user').one('checkUname', uname).get().then(
  function (valid) {
    //check here
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download