Noufal Noufal - 4 months ago 34x
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 ?


try to do this:

Restangular.all('user').one('checkUname', uname).get().then(
  function (valid) {
    //check here