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?

4

1 回答 1

7

像下面这样声明模块。

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

然后在 HTML 上更改 ng-app,如下所示。

ng-app="app"

这会对你有所帮助。谢谢。

于 2015-01-23T22:20:12.713 回答