I'm trying to create a new angular service for my Ionic app, however the new javascript file is 'mysteriously' causing the app to behave inappropriately, for e.g. when I call the $cordova.getDevice() method it returns me the results that would usually get from call CacheFactory.get("cache_key").
I tried removing all the code from the file, even with the code there were error reported in the console, I tried changing the name of the service.Although there is barely any code in the .js file, it still causes the app to crash.
The only thing that works is removing the completely removing the file reference from the index.html file, thereafter the app behaves normally.
Here's the angular service:
function() {
'use strict';
angular.module('starter').factory('TokenService', ['$http', '$q', '$ionicLoading', 'StringService', TokenService]);
function TokenService($http, $q, $ionicLoading, StringService){
}
})();
As mentioned previously, even with the little code it has, it still causes issues.