【问题标题】:Angular Meteor 1.3 Ionic - how add ngCordova?Angular Meteor 1.3 Ionic - 如何添加 ngCordova?
【发布时间】:2016-09-05 19:05:32
【问题描述】:

我想在我的 Angular Meteor 1.3 Ionic 项目中添加 ngCordova。

=> 我在 google chrome 控制台上遇到了这个错误: partyAdd.js:30 Uncaught TypeError: _angular2.default.module(...).component is not a function

=> 我在 Ios Simulator 控制台(在 Safari 上)遇到了这个错误: TypeError: _angular2['default'].module(name, [_angularMeteor2['default']]).component 不是函数。 (在 '_angular2['default'].module(name, [_angularMeteor2['default']]).component', '_angular2['default'].module(name, [_angularMeteor2['default']]).component ' 未定义)

您能帮我添加 ngCordova 吗? 来自这个教程:http://www.angular-meteor.com/tutorials/socially/angular1/ionic

谢谢

【问题讨论】:

  • 这里一样..有解决方案吗?

标签: angularjs meteor ionic-framework ngcordova


【解决方案1】:

我找到了一个解决方案,看看它是否适合你:

首先安装角度组件

  • meteor npm install --save angular-component

然后添加你的 main.js

  • 导入“角度组件”;

【讨论】:

  • 我没有发现 angular-component 与 ng-cordova 有任何关系。看起来 angular-component 只是一个 polyfill,用于让您在 Angular 1 项目中以 Angular2 语法编写组件——也许如果您运行的是
【解决方案2】:

npm install --save ng-cordova

然后,在您定义主应用程序的角度模块的地方(在我的例子中位于 app.js 的顶部)添加:

import 'ng-cordova'

当然,如果您从 Meteor 1.2 升级,请删除您可能为 ngCordova 安装的所有 Atmosphere 包

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-07-16
    • 2016-07-31
    • 2016-07-19
    • 1970-01-01
    • 1970-01-01
    • 2016-10-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多