Does anyone have any idea why my $scope.$watch
does not work, this $scope.paciente.telefones
is attached to a combobox.
$scope.$watch('paciente.telefones', function(oldv, newv) {
var existeCelularComEnvioSms = false;
angular.forEach($scope.paciente.telefones, function(tel) {
if (tel.envioSms == true) {
existeCelularComEnvioSms = true;
} else if(existeCelularComEnvioSms == true) {
tel.envioSms = false;
}
});
});