Simple restangular example broken with AngularJS 1.2


I’m doing a basic Restangular example and it works on AngularJS 1.1, however on 1.2, the REST request is sent, data is received, but the table is not displayed properly.

I read through some threads here about upgrading from 1.1 to 1.2 but I don’t see the issue as the example is very simple and does not explicitly use ngRoute, isolated scopes or custom directives.


<!DOCTYPE html>

<html ng-app="countries">

    <meta charset="utf-8" />
    <title>REST Country Example</title>
    <link rel="stylesheet" href="//">
    <script src="//"></script>
    <script src="//"></script>
    <script src="//"></script>
    <script src="//"></script>

    <script src="app.js"></script>

  <body ng-controller="mainCtrl">
    <h2>Restangular Example with</h2>

      <input type="text" ng-model="search" class="search-query" placeholder="Search">
      <table class="table table-responsive table-striped">
        <tr ng-repeat="country in countries | filter:search | orderBy:'name'">





app = angular.module('countries', ['restangular']);
app.config(function(RestangularProvider) {

app.controller('mainCtrl', function($scope, Restangular) {
  $scope.countries = Restangular.all('all').getList();

1.1.5 Plunk (working)

1.2.27 Plunk (not working)

Any idea what is missing/incorrect in order to get this working properly on 1.2?



I have never used restangular before. Looks like it returns a promise for 1.2 version, instead of data, I am able to load the data with this minor modification:

app.controller('mainCtrl', function($scope, Restangular) {
  Restangular.all('all').getList().then(function(result) {
    $scope.countries = result;


Answered By – udalmik

Answer Checked By – Katrina (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.