5

I wanted to make input mask, in case CNPJ.

Then I saw it here.

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

But not getting to implement.

See the excerpt from my code, in which case it 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 is missing to work?

Pankaj Parkar
  • 134,766
  • 23
  • 234
  • 299
Regis Santos
  • 3,469
  • 8
  • 43
  • 65

1 Answers1

7

Declare module like below.

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

And then change ng-app on HTML like below.

ng-app="app"

This would help you. Thanks.

PSL
  • 123,204
  • 21
  • 253
  • 243
Pankaj Parkar
  • 134,766
  • 23
  • 234
  • 299