javascriptangularjskendo-uikendo-maskedtextbox

Change the mask of Kendo MaskedTextBox in angular


I am using the below code to set up the Kendo MaskedTextBox

<input type="text" kendo-masked-text-box k-mask="contact.Mask"  ng-model="contact.PhoneNumber" />

In my angular Mask is initially set to empty and then I change it in a function. Example :

$scope.contact.Mask = '';
$scope.changeMask = function(){
    $scope.contact.Mask = '(999) 000-0000';
}

Calling this function does change the value of $scope.contact.Mask but the actual textbox does not reflect the change.

Please let me know in case any other information is requried.


Solution

  • Use k-rebind="contact.Mask". This should solve your problem.