pickhunter
pickhunter

Reputation: 356

How to read URL from a restangular resource?

I have a restangular resource:

$scope.user.one('messages', 123).one('from', 123).getList('unread').then(function(unread){
  $scope.unread = unread;
});
// GET: /users/123/messages/123/from/123/unread

I want to retrieve the RESTUrl from the $scope.unread, something like

$scope.unread.getRESTUrl();
//returns /users/123/messages/123/from/123/unread

I have tried to inspect the restangular object to every extent possible. Anyone knows how to get the RESTUrl?

Upvotes: 2

Views: 53

Answers (1)

pickhunter
pickhunter

Reputation: 356

My bad. Its right there. Somehow it was invisible to me.

obj.getRestangularUrl();

Upvotes: 2

Related Questions