Despite defining my service name in all necessary places, I am still encountering the error mentioned above.
Below is my app.js:
var app = angular.module('ionicApp', [ 'ionic', 'ngCordova', 'checklist-model' ])
app.config(function($stateProvider, $urlRouterProvider) {
});
app.run([
'$rootScope',
'ngCart',
'ngCartItem',
'store',
'$window',
'$ionicPlatform',
'RequestsService',
function($rootScope, ngCart, ngCartItem, store, $window,
$ionicPlatform, RequestsService) {
$ionicPlatform.ready(function() {
pushNotification = window.plugins.pushNotification;
window.onNotification = function(e) {
console.log('notification received');
switch (e.event) {
case 'registered':
if (e.regid.length > 0) {
var device_token = e.regid;
alert(device_token);
RequestsService.register(device_token).then(
function(response) {
alert(JSON.stringify(response));
alert("register!");
});
}
break;
case 'message':
alert('msg received');
alert(JSON.stringify(e));
break;
case 'error':
alert('error occured');
break;
}
};
window.errorHandler = function(error) {
alert('an error occured');
}
pushNotification.register(onNotification, errorHandler, {
'badge' : 'true',
'sound' : 'true',
'alert' : 'true',
'senderID' : 'your sender id',
'ecb' : 'onNotification'
});
});
$rootScope.$cart = {
items : []
};
if (angular.isObject(store.get('cart'))) {
ngCart.$restore(store.get('cart'));
} else {
ngCart.init();
}
} ]);
My index.html :-
<html ng-app="ionicApp">
<head>
<head>
<meta charset="utf-8">
<meta name="viewport"
content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>App-name</title>;
<link href="lib/ionic/css/ionic.css" rel="stylesheet"><
link href="css/style.css" rel="stylesheet"><
script type="text/javascript" charset="utf-8"
src="js/PushNotification.js"></script><
<script src="lib/ionic/js/ionic.bundle.js"></script><
<!-- cordova script (this will be a 404 during development) --><
<script src="lib/ngCordova/dist/ng-cordova.js"></script><
<script src="js/ng-cordova.min.js"></script><
<script src="cordova.js"></script><
<!-- your app's js --><
<script src="js/app.js"></script><
<script src="js/checklist-model.js"></script><
<script src="js/controllers.js"></script><
<script src="js/services.js"></script><
<script src="js/cart.js"></script><
<script src="js/RequestsService.js"></script><
<script src="js/angular-translate.min.js"></script><
</head><
<body ng-controller="MainCtrl">
<ion-nav-view></ion-nav-view><
</body><
/html>
Here is my RequestsSerice.js :
$J6oZcip/latest
I want to mention that everything was functioning properly initially, but after updating Cordova to the latest version, my app stopped working.
I have double-checked the spellings, yet I still encounter the aforementioned error when running the code.