The component should treat this case as well as other similar plugins. However, I have created a directive that solves your problem. Follow below:
// no Controller
$scope.cliente = { telefone: 0 }
$scope.phoneMask = "(99) 9999-9999";
//HTML
<input type='text' ng-model='cliente.telefone' ui-mask="{{phoneMask}}" mask-change="phoneMask" />
// Diretiva
app.directive('maskChange', function() {
return {
restrict: 'A',
scope: {
maskChange: "=",
},
require: '?ngModel',
link: function(scope, elem, attrs, ngModel) {
var novoTel, flag = false, val;
elem.off('keyup');
elem.on('keyup', function(ev) {
if (/^\d+$/.test(ev.key) || ev.key == 'Backspace' || ev.key == 'Delete') {
novoTel = String(ngModel.$viewValue).replace(/[\(\)\_\-/\s]/g, '')
if (novoTel.length == 10 && !flag) {
flag = true;
scope.maskChange = "(99) 9999-9999";
scope.$apply();
} else if (novoTel.length == 10 && flag) {
flag = false;
scope.maskChange = "(99) 9?9999-9999";
scope.$apply();
ngModel.$viewValue += ev.key
ngModel.$render();
} else if (novoTel.length < 10) {
flag = false;
}
}
})
}
};
})