2016-01-14 63 views
2

我下面這些教程 tutorial1tutorial2離子分析不起作用

,我已經做了很多研究的,沒有什麼工作=(

angular.module('starter', ['ionic','ngSanitize', 'ionic.service.core', 'ionic.service.analytics']) 

.run(function($ionicPlatform,$ionicAnalytics) { 
    $ionicPlatform.ready(function() { 

$ionicAnalytics.register(); 


// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard 
// for form inputs) 
if(window.cordova && window.cordova.plugins.Keyboard) { 
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); } 
if(window.StatusBar) { 
//StatusBar.styleDefault(); 
StatusBar.overlaysWebView(true); 
StatusBar.style(1) 
} 
}); 
}) 

這是錯誤:

Uncaught Error: [$injector:modulerr] Failed to instantiate module starter due to: 
Error: [$injector:modulerr] Failed to instantiate module ionic.service.core due to: 
Error: [$injector:nomod] Module 'ionic.service.core' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. 
http://errors.angularjs.org/1.4.3/$injector/nomod?p0=ionic.service.core 
+0

試無功對象= angular.module(...),看看 –

+0

嗨,我現在面臨同樣的問題,但現在我使用[ngCordova(HTTP:// ngcordova。 com)爲Android應用程序和瀏覽器直接使用谷歌分析腳本。 –

+0

您是否運行過: ionic add ionic-platform-web-client –

回答

0

運行ionic config build

不完全確定爲什麼這是必要的,我假設調用ionic add ionic-platform-web時,配置文件未被修改。

當將repo克隆到另一臺機器時,這一步也是必要的,這是我遇到錯誤的方式。

得到了這裏的解決方案:https://github.com/driftyco/ionic-platform-web-client/issues/29