【问题标题】:Ionic social share is undefined离子社交分享未定义
【发布时间】:2016-07-16 06:03:14
【问题描述】:

我正在尝试使用 ionic 中的教程示例

window.plugins.socialsharing.shareWithOptions(options, onSuccess, onError);

但我不断得到

ionic.bundle.js:20306 TypeError: Cannot read property 'socialsharing' of undefined

我想我在 app.js 中遗漏了一些东西来包含库?

angular.module('starter', ['ionic','leaflet-directive', 'ngCordova', ... ?

我需要在上面的行中加载它吗? 我是否必须将其作为模块加载到控制器中?教程上没找到,不清楚吗?

我多次尝试cordova plugin add,无论是作为包名还是通过git

【问题讨论】:

    标签: javascript angularjs cordova ionic-framework socialshare


    【解决方案1】:

    原来我查看了错误的文档。如果使用 ionic,请查看 ngCordova 文档而不是官方软件包文档。它们不一致。

    我必须将$cordovaSocialSharing 添加到我的控制器中,它在设备上运行,而不是在模拟器中,也不是在我的开发浏览器 chrome 中。

    【讨论】:

      猜你喜欢
      • 2016-07-20
      • 2017-06-07
      • 1970-01-01
      • 2012-01-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-29
      • 1970-01-01
      相关资源
      最近更新 更多