【问题标题】:Ionic analytics doesn’t work离子分析不起作用
【发布时间】:2016-04-19 04:22:26
【问题描述】:

我正在关注这些教程 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

【问题讨论】:

  • 试试 var object = angular.module(...) 看看
  • 您好,我也面临同样的问题,但现在我将ngCordova 用于 Android 应用程序和直接使用谷歌分析脚本的浏览器。
  • 你跑了吗:ionic add ionic-platform-web-client

标签: angularjs ionic-framework ionic analytics


【解决方案1】:

运行ionic config build

不完全确定为什么这是必要的,我假设在调用ionic add ionic-platform-web 时配置文件没有被修改。

在将 repo 克隆到另一台机器时,这一步也是必要的,这就是我遇到错误的原因。

从这里获得解决方案:https://github.com/driftyco/ionic-platform-web-client/issues/29

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-10-07
    • 2016-02-16
    • 2019-04-11
    • 2017-08-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多