angular/angular.js — pull request #3456 by perymimon (2013-08-02 14:50:36+00:00)
Title: add ability for "default Model" to resource

add ability for "default Model" on $resource so you can do nice think like that:

```javascript
.factory('User',function($resource){
var model = {
contacts:[],
logos:[]
};
var User = $resource('user/:id/:action',{id:'@_id'},model,{
get: { method:'GET', params:{action:''} },
remove:{ method:'GET', params:{action:'remove'} },
save:{ method:'POST', params:{action:'' } },
list:{ method:'GET', params:{action:'list'},isArray:true) }
});

return User;

});

function ctrl($scope,User){
$scope.user = new User()
}

/*
$scope.user = {
contacts:[],
logos:[]
$get:function,
$remove:function
$save:function,
$list:function
}
*/
```

so your controller not throw exception when you try to add something to array that not exsist