I have the following html:
<input type="text" ng-model="skype" ng-change="checkInput('skype')">
function:
$scope.checkInput = function(value) {
var string = $scope[value],
pattern = /[^a-zA-Z]+/g;
string = string.replace(pattern, '');
}
Now the .log console shows that the line has successfully changed, however, the view is not updated. The strangest part is when using the view updates substring!
string = string.substring(0, 10);
What's wrong?
source
share