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