Javascript 未捕获错误:[$injector:modulerr]在添加$cordovaGeolocation和$ionicPopup时未能实例化模块

Javascript 未捕获错误:[$injector:modulerr]在添加$cordovaGeolocation和$ionicPopup时未能实例化模块,javascript,angularjs,cordova,geolocation,ionic-framework,Javascript,Angularjs,Cordova,Geolocation,Ionic Framework,我的应用程序运行良好,我安装了cordova geolocation,但在添加$cordovaGeolocation和$ionicPopup后,什么都不起作用,我重拨了几次代码,检查并重新检查拼写,等等 这是我的错误: 未捕获错误:[$injector:modulerr]未能实例化模块caffeinehit,原因是:错误:[$injector:modulerr]未能实例化模块caffeinehit.services,原因是:错误:[$injector:nomod]模块“caffeinehit.s

我的应用程序运行良好,我安装了cordova geolocation,但在添加$cordovaGeolocation和$ionicPopup后,什么都不起作用,我重拨了几次代码,检查并重新检查拼写,等等

这是我的错误:

未捕获错误:[$injector:modulerr]未能实例化模块caffeinehit,原因是:错误:[$injector:modulerr]未能实例化模块caffeinehit.services,原因是:错误:[$injector:nomod]模块“caffeinehit.services”不可用!您要么拼错了模块名,要么忘记加载它。如果注册模块,请确保将依赖项指定为第二个参数

app.js的顶级代码:

var app = angular.module('caffeinehit', [
'ionic',
'ngCordova',
'caffeinehit.controllers',
'caffeinehit.services',
'caffeinehit.filters'
]))

services.js代码:

var-app=angular.module('caffeinehit.services',[]);
app.service(“YelpService”,函数($q、$http、$cordovaGeolocation、$ionicPopup){
var-self;
自我={
“页面”:1,
“isLoading”:false,
“哈斯莫尔”:没错,
“结果”:[],
“lat”:51.545540,
“lon”:-0.0223374,
“加载”:函数(){
self.isload=true;
var deferred=$q.deferred();
ionic.Platform.ready(函数(){
$Cordova地理定位
.getCurrentPosition({超时:10000,启用高精度:false})
.然后(功能(位置){
self.lat=位置坐标纬度;
self.lon=位置.坐标.经度;
后来在添加$ionicPopup时遇到问题:

 }, function (err) {
            console.error("Error getting position");
            console.error(err);
            $ionicPopup.alert({
              'title': 'Please switch on your gps',
              'template': "It seems like you switch off your gps, please turn it on"
            });

你需要在你的应用程序模块中包括爱奥尼亚和科尔多瓦

var app = angular.module('caffeinehit.services', ['ionic', 'ngCordova']);

我发现了这个问题,一旦我改变了订单,在应用模块中将$ionicPopup放在$cordovaGeolocation之前,它就成功了