1
I’m trying to use the angular mask-input-masks in the Angularjs (Ionic v1) found in the link:
https://assisrafael.github.io/angular-input-masks/
I follow all the steps in the documentation:
https://github.com/assisrafael/angular-input-masks
but the following problems happen when I try to import the script into my index.html:
<script src="angular-input-masks-standalone.min.js"></script>
the following error is displayed:
then, I continue the steps that are in the manual, "add ui.utils.masks to the module" with the following script:
angular.module('app', ['ui.utils.masks']);
But the following error is displayed:
Well, I did several searches and found a post here with the same problem: Problems with angular-input-masks? but the solution did not resolve for me is displayed error 404 on get, I will post my app.js code where I import all modules and my index.html.
// Ionic Starter App
angular.module('starter', ['ionic',
'starter.services',
'starter.controllers',
'starter.pagamento',
'starter.calculadora',
'starter.adicionar-itens',
'ui.utils.masks'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
if (window.cordova && window.Keyboard) {
window.Keyboard.hideKeyboardAccessoryBar(true);
}
if (window.StatusBar) {
StatusBar.styleDefault();
}
});
})
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('app', {
url: '/app',
abstract: true,
templateUrl: 'templates/menu.html',
controller: 'AppCtrl'
})
.state('app.calculadora', {
url: '/calculadora',
views: {
'menuContent': {
templateUrl: 'templates/calculadora.html',
controller: 'CalculadoraCtrl'
}
}
})
.state('app.adicionar-itens', {
url: '/adicionar-itens',
views: {
'menuContent': {
templateUrl: 'templates/adicionar-itens.html',
controller: 'AdicionarItensCtrl'
}
}
})
.state('app.pagamento', {
url: '/pagamento',
views: {
'menuContent': {
templateUrl: 'templates/pagamento.html',
controller: 'PagamentoCtrl'
}
}
});
// if none of the above states are matched, use this as the fallback
$urlRouterProvider.otherwise('/app/adicionar-itens');
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link rel="manifest" href="manifest.json">
<!-- un-comment this code to enable service worker
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service-worker.js')
.then(() => console.log('service worker installed'))
.catch(err => console.log('Error', err));
}
</script>-->
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/calculadora.css" rel="stylesheet">
<link href="css/pagamento.css" rel="stylesheet">
<link href="css/alertaPopup.css" rel="stylesheet">
<link href="css/adicionar-itens.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<script src="lib/snet-barcode.js"></script>
<script src="lib/alerta_popup.js"></script>
<script src="angular-input-masks-standalone.min.js"></script>
<!-- <script src="https://assisrafael.github.io/angular-input-masks/javascripts/masks.js"></script> -->
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/services.js"></script>
<script src="js/controllers.js"></script>
<script src="js/pagamento.js"></script>
<script src="js/calculadora.js"></script>
<script src="js/adicionar-itens.js"></script>
</head>
<body ng-app="starter">
<ion-nav-view></ion-nav-view>
<div id="alerta_popup" class="alerta_popup alerta_popup__delete">
Alerta
</div>
</body>
</html>
I also tried every way to run it, but from what I checked the files contained in git and NPM are incomplete.
– César Augusto