There is a list of users extracted from rest api. Here is the template
<div ng:controller="UserController"> <a ng-click="createUser()">Create User</a> <div ng-view> <ul> <li ng-repeat="user in users"> {[{user.first_name}]} {[{user.last_name}]} </li> </ul> </div> </div>
JS:
function UserController($scope, User, Group){ $scope.users = User.query(); $scope.createUser = function(){ //$scope.users = null; //$scope.users.pop(); //$scope.users.push(new User({id:'5'})); console.log($scope.users); } }
Service: http://dpaste.com/1065440/
All users are correctly loaded and specified. The problem is that I cannot manipulate the displayed list at all. No matter what I do, push, pop or set to null. The list does not change in the template. However, the last log statement shows the changes, it prints, for example. NULL if the users array is set to null.
Any ideas what the problem is?
source share