Input mask with masks angular -Input-mask

I wanted to create an input mask, in the case of CNPJ.

Then I saw it here.

https://github.com/assisrafael/angular-input-masks/

But it is impossible to implement.

See an excerpt from my code, in which case this did not work.

<html>
<head>
    <meta charset="utf-8">
    <script src="angular.js"></script>
    <script src="js/masks.min.js"></script>

    <script>
        angular.module('ui.utils.masks');
    </script>

</head>
<body ng-app>
    <ul>
        <li><a href="teste.html">Teste</a></li>
    </ul>

    <div>
        <label>CNPJ:</label>
        <input type="text" ng-model="cnpj" ui-br-cnpj-mask>
    </div>

</body>
</html>

What does not work?

+4
source share
1 answer

Declare the module as shown below.

angular.module('app',['ui.utils.masks'])

And then change the ng app to HTML as below.

ng-app="app"

This will help you. Thank.

+6
source

All Articles