Suppose if I have a watch function that watches a model like this..
$scope.$watch('number', function () { $scope.number = $scope.number.replace(/\D/, ''); $scope.number = $scope.number.replace(/\s+/g, ''); $scope.number = $scope.number .replace(/[\W]/g, ''); });
This function restricts user from entering special characters and alphabets in the input text box.
And I have another text box which uses another model say ng-model="faxNumber"
Can I add this model name as well in my watch function or should I use a different watch function?
Thanks