I've got a piece of code that looks like this:
$scope.renameUser = function(key,name) {
console.log('renameUser, key: ', key);
console.log('renameUser, name: ', name);
var userOne = $scope.users.$key(key);
userOne.$key('displayName').$set(name);
};
It works, but you need to reload the page to see the updated result. I would like it to update instantly.
During debugging I added this part, but I never get it to trigger... Any ideas what is going on?
$scope.users.$on('set', opts, function(value) {
console.log(value);
});
This issue was introduced in v3.2.0. The
$keymethod, whether it's being called on a model returned by a$goQueryor$goKeyshould return a 'new' model associated with a 'relative' key. Instead it was recycling the service associated with the first key used.This issue has been fixed in v3.2.2, upgrading to this version should resolve your issue.
Thanks for sharing!