简体   繁体   English

Angular Meteor 1.3 Ionic-如何添加ngCordova?

[英]Angular Meteor 1.3 Ionic - how add ngCordova?

I would like to add ngCordova in my Angular Meteor 1.3 Ionic Project. 我想在Angular Meteor 1.3 Ionic Project中添加ngCordova。

=> I've got this error on google chrome console : partyAdd.js:30 Uncaught TypeError: _angular2.default.module(...).component is not a function =>我在谷歌浏览器控制台上遇到以下错误: partyAdd.js:30未捕获的TypeError:_angular2.default.module(...)。component不是函数

=> I've got this error on Ios Simulator console (on Safari) : TypeError: _angular2['default'].module(name, [_angularMeteor2['default']]).component is not a function. =>我在Ios Simulator控制台(在Safari上)遇到此错误: TypeError:_angular2 ['default']。module(name,[_angularMeteor2 ['default']])。component不是一个函数。 (In '_angular2['default'].module(name, [_angularMeteor2['default']]).component', '_angular2['default'].module(name, [_angularMeteor2['default']]).component' is undefined) (在'_angular2 ['default']。module(name,[_angularMeteor2 ['default']])。component'中,'_angular2 ['default']。module(name,[_angularMeteor2 ['default']]))。component '未定义)

Could you help me please to add ngCordova ? 您能帮我添加ngCordova吗? from this tutoriel : http://www.angular-meteor.com/tutorials/socially/angular1/ionic 来自这个老师: http ://www.angular-meteor.com/tutorials/socially/angular1/ionic

Thank you 谢谢

I found a solution, see it fits for you: 我找到了解决方案,认为它很适合您:

First install angular-component 首先安装角度组件

  • meteor npm install --save angular-component 流星NPM安装-保存角度组件

Then add in your main.js 然后添加您的main.js

  • import 'angular-component'; 导入“角度组件”;

npm install --save ng-cordova

Then, where you define your main app's angular module (in my case at the top of app.js) add: 然后,在定义主应用程序的angular模块的位置(以我为例,在app.js顶部)添加:

import 'ng-cordova'

Of course, remove any Atmosphere package you might have had for ngCordova if you're upgrading from Meteor 1.2 当然,如果要从Meteor 1.2升级,请删除任何可能用于ngCordova的Atmosphere软件包

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM