Trying to erase the history of an app made with ionic create a new module, but trying to inject it generates the following problem
ionic.bundle.min.js: 40 Uncaught Error: [$ injector: modulerr] link $ injector / modulerr? p0 = unicesarApp & p1 = Erro ...% 2F% 2Flocalhost% 3A8100% 2Flib% 2Fionic% 2Fjs% 2Fionic.bundle.min.js% 3A74% 3A503)
index.html
<script src="lib/ionic/js/ionic.bundle.min.js"></script>
<script src="lib/ngCordova/dist/ng-Cordova.js"></script>
<script src="cordova.js"></script>
<script src="js/app.js"></script>
<script src="App/login.js"></script>
<script src="App/historial.js"></script>
login.js
angular.module('unicesarApp', ['ionic', 'historialApp'])
.controller('formulario', formulario)
.service('obtenerDatos', obtenerDatos)
.config(config);
config.$inject = ['$stateProvider', '$urlRouterProvider', 'historial'];
.state('menuestu',{
url: '/menuestu',
templateUrl: "Templates/Estudiante/menuestu.html",
controller: "historialApp"
})
history.js
angular.module('historialApp', ['ionic'])
.controller('historial', historial);
historial.$inject = ['$ionicHistory'];
function historial($ionicHistory){
$ionicHistory.clearHistory();
}
menu.html - template
<ion-header-bar class="bar-balanced" align-title="center">
<p class="title">Menu Estudiante</p>
</ion-header-bar>
<ion-view>
<ion-content has-header="true">
<div class="container" ng-controller="historial">
</div>
</div>
</ion-content>
At the moment of injecting the module and trying to call the controller that I added to that module to erase the history, an error is created, and an error is created if it was removed and called from app. js , because when you try to enter the menu view the error comes out and does not progress.
I would like to know what is wrong, if it is the way to inject or call the controller, thank you in advance.