How to use Angular input Mask

Asked

Viewed 4,402 times

3

I use Angularjs and Ionic and am trying to use this Input Mask, but I don’t quite know how to do it. I follow the steps and yet this error appears: Angular Error.

References in index.html:

<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
<script src="js/services.js"></script>
<script src="../angular-input-masks/releases/angular-input-masks-standalone.min.js"></script>

app js.:

angular.module('starter', ['ionic', 'ui.utils.masks','starter.controllers', 'starter.services'])
  • What error does it show you? On your console.

  • Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.3.13/$injector/modulerr? P0=starter&p 1=Error%3... code.ionicframework.com%2F1.0.0-rc.5%2Fjs%2Fionic.bundle.min.js%3A48%3A381)

  • I think we missed adding the js of Ionic

  • Already there, it’s just above. I didn’t put it here so it wouldn’t get too big. <! -- Ionic/Angularjs js --> <script src="http://code.ionicframework.com/1.0.0-rc.5/js/ionic.bundle.min.js"></script>

1 answer

4


The problem is that the reference to the file angular-input-masks-standalone.min.js was out of the folder www, making the file inaccessible. In this way it worked.

Right shape

<script src="mask/angular-input-masks-standalone.min.js"></script>

Wrong shape

<script src="../angular-input-masks/releases/angular-input-masks-standalone.min.js"></script>

At least here it worked.

  • https://github.com/assisrafael/angular-input-masks no folder /angular-input-masks available/

  • In my package had, take a look at yours for something equivalent.

Browser other questions tagged

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