Regis Santos
Regis Santos

Reputation: 3749

Input Mask with angular-input-masks

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?

Upvotes: 5

Views: 6180

Answers (1)

Pankaj Parkar
Pankaj Parkar

Reputation: 136144

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.

Upvotes: 7

Related Questions