I am currently working with the following controller:
function EntryCtrl($scope, Restangular){
console.log("*** EntryCtrl");
$scope.roles= Restangular.all("roles").getList();
console.log("*** EntryCtrl: " + JSON.stringify($scope.roles));
}
After running this code, the console output displays:
*** EntryCtrl: {"restangularCollection":true}
However, when I use a rest browser plugin to make the same rest call, the response is:
[
{
"name": "dev"
}
]
I am struggling to find a way for Angular to process the response in the same way as the rest browser plugin does. My main objective is to extract and display the role name, "dev", using Angular. I would like to implement an Angular page that uses "ng-show" on a link based on the role name. Here's an example of how I want to achieve this:
<a href="" ng-show="roles.contains('')>Foo</a>