Using values directly in templates

Since Angular 1.2, Promise unwrapping in templates has been disabled by default and will be deprecated soon.

This means that the following will cease to work:

$scope.accounts = Restangular.all('accounts').getList();
<tr ng-repeat="account in accounts">
  <td>{{account.name}}</td>
</tr>

As this was a really handy way of working with Restangular, I've made a feature similar to $resource that will enable this behavior again:

$scope.accounts = Restangular.all('accounts').getList().$object;
<tr ng-repeat="account in accounts">
  <td>{{account.name}}</td>
</tr>

The $object property is a new property I've added to promises. By default, it'll be an empty array or object. Once the sever has responded with the real value, that object or array is filled with the correct response, therefore making the ng-repeat work :). Pretty neat :D