8
<form name="myForm" ng-submit="addState(myForm.$valid)" novalidate >
<input ng-model="data.cnpj" type="number" ui-mask="999.999.999-99" placeholder="CNPJ" required ng-minlength="6" ng-maxlength="12" ng-pattern="/^[0-9]{1,7}[-\.\/]?+$/">
</form>
What to put in controller for ui-Mask to work?
I tried it but it didn’t work.
mainAppControllers.controller('Ctrl', ['myservice','$rootScope','$scope', '$routeParams', '$location','$timeout',
function(myservice, $rootScope, $scope, $routeParams, $location,$timeout ){
have already tried to import "ui-utils" or "ui.Mask" ?
– Rod
Yeah, it didn’t happen :(
– Claudia Mardegan
@Claudiamardegan You carried the
ui-utils.js
and imported theui-utils
? Any error appears in the console?– André Ribeiro
No error appears, I managed to make it catch, but it only works in the 1 item in the second did not create the mask. <input ng-model="data.cnpj" type="text" ui-Mask="999.999.-99" ng-Pattern="/ [0-9]{1,7}[-. /]?+ $/"> <input ng-model="data.data" type="text" ui-Mask="00/00/0000" ng-Pattern="/ [0-9]{1,7}[-./]?+$/">
– Claudia Mardegan
@Andréribeiro what your Inkedin?
– Claudia Mardegan