为cordova和网站的流星应用程序使用不同的客户端代码库 [英] Using different client code base for a meteor app for cordova and website

查看:127
本文介绍了为cordova和网站的流星应用程序使用不同的客户端代码库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道在这个问题上还有其他(相当古老的)问题,但我没有看到流星1.0的任何答案。我正在构建一个针对移动设备和桌面设备的应用。

I know there are other (rather old) questions on this subject but I haven't seen any answer with meteor 1.0. I am building an app targeting both mobile and desktop.

我移植了一个使用离子创建的现有移动客户端,它运行良好。现在我想设置桌面客户端部分,不想在任何地方添加if(Meteor.isCordova){子句。我可以分享我的一些自定义Angular指令或服务,但Ionic只是移动目标,所以我希望明确代码分离。

I ported an existing mobile client created with ionic and it's working great. Now I would like to setup the desktop client part and don't want to add "if (Meteor.isCordova) {" clauses everywhere. I could share some of my custom Angular directives or services but Ionic is mobile targeted only so I want clear code separation.

有什么建议吗?

推荐答案

如何将包用于共享逻辑并拥有两个不同的流星项目或包?一个用于web(例如meteor + bootstrap),另一个用于移动(例如meteor + ionic)?

How about using a package for the shared logic and have two different meteor projects or packages? One for web (e.g. meteor+bootstrap) and the other for mobile (e.g. meteor+ionic)?

也许是这样的: https://github.com/Compy/meteor-mobile-desktop

这篇关于为cordova和网站的流星应用程序使用不同的客户端代码库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆