Problems with angular-input-masks?

Asked

Viewed 4,164 times

3

I am trying to use this module that is available on github and I think this module is very complete, provides the masks I need, however is very confusing its documentation.

The point is, I cloned the gihub project and ran the folder demo, in the code lines of the file index (lines 8 and 9), he references the files Javascript which should be in the repository, but are not, simply do not exist, but need not panic, I found all the files at this link.

When referencing, connecting the files Javascriptto HTML, everything straight, was to work the [demo], however the same presents some errors, for example:

Erro que apresenta no console

and inside the archive angular-input-masks-dependencies.js there is the comrade of error:

function min () 
{
    var args = [].slice.call(arguments, 0);
    return pickBy('isBefore', args);
}

Can someone help me use this module without errors?

1 answer

4


To function correctly use this address:

https://assisrafael.github.io/angular-input-masks/javascripts/masks.js

which is already the file with everything you need to perform these masks on

angular.module('demo', ['ui.utils.masks'])
  .controller('ctrl', function($scope) {
    $scope.phoneNumber = "";
  });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.28/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-i18n/1.6.6/angular-locale_pt-br.js"></script>
<script src="https://assisrafael.github.io/angular-input-masks/javascripts/masks.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment-with-locales.min.js"></script>


<div ng-app="demo" ng-controller="ctrl">
<h4>ui-number-mask</h4>
  <p>
    <input type="text" name="field1" ng-model="number1" ui-number-mask ui-number-min="0">
  </p>
  <p>
    <input type="text" name="field2" ng-model="number2" ui-number-mask="3" ui-number-min="0">
  </p>
  <p>
    <input type="text" name="field3" ng-model="number3" ui-number-mask="4" ui-negative-number ui-number-min="0">
  </p>
  <p>
    <input type="text" name="field4" ng-model="number4" ui-number-mask ui-number-min-max="100.9" ui-number-min="10.1"></p>
  <p>
    <input type="text" name="field5" ng-model="number" ui-number-mask ui-hide-group-sep>
  </p>

<h4>ui-br-phone-number</h4>
<p><input type="text" name="field10" ng-model="phoneNumber" ui-br-phone-number></p>

<h4>ui-br-cep-mask</h4>
<p><input type="text" name="field11" ng-model="cep" ui-br-cep-mask></p>

<h4>ui-br-cpf-mask</h4>
<p><input type="text" name="field12" ng-model="initializedCpf" ui-br-cpf-mask></p>

<h4>ui-br-cnpj-mask</h4>
<p><input type="text" name="field13" ng-model="initializedCnpj" ui-br-cnpj-mask></p>

<h4>ui-br-cpfcnpj-mask</h4>
<p><input type="text" name="field14" ng-model="initializedCpfCnpj1" ui-br-cpfcnpj-mask></p>

<h4>ui-br-ie-mask</h4>
<p>
<select ng-init="ufs=['AC','AL','AM','TO']" ng-model="selectedUF" ng-options="uf for uf in ufs"></select>
<input type="text" name="field19" ng-model="ieField" ui-br-ie-mask='selectedUF'></p>

</div>

  • I thought it would only fix my Portuguese mistakes, but no, it solved the problem completely. It was only necessary to lynch the correct JS, masks.js

Browser other questions tagged

You are not signed in. Login or sign up in order to post.