I have this:
$scope.$watch('option.sCreatedBy', function (newValue, oldValue) {
if (newValue && newValue !== oldValue) {
_u.oyc.put('sCreatedBy', newValue);
$scope.grid.data = null;
}
});
$scope.$watch('option.sModifiedBy', function (newValue, oldValue) {
if (newValue && newValue !== oldValue) {
_u.oyc.put('sModifiedBy', newValue);
$scope.grid.data = null;
}
});
Functionality is the same for all of these plus a few more than I don't show above.
Is there a way I could combine these watches into one watch and watch / modify multiple things at once ?