So recently I've been updating something that looks like the below:
$scope.arrayOfThings = [];
function setArrayOfThings() {
thingsService.get().then(function (things) {
$scope.arrayOfThings = things;
});
}
$scope.$on('arrayOfThings.add', setArrayOfThings);
To look more like this (using the lesser-known promise integration into bindings...):
$scope.arrayOfThings = thingsService.get();
But how do I force arrayOfThings
to update (or re-resolve?) when the collection is changed from another $scope
?