使用离子作为桌面Web应用程序 [英] Use of ionic as desktop web application

查看:153
本文介绍了使用离子作为桌面Web应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Ionic是使用html5开发移动应用程序的绝佳框架。我们也希望在桌面浏览器上使用相同的应用程序。制作一个在桌面浏览器和移动浏览器上都能发挥最佳效果并制作应用程序的响应式用户界面是不是一个好主意。或者我们应该为浏览器和移动应用程序进行不同的开发。

Ionic is a great framework to develop mobile apps using html5. We want same application to be used over desktop browser also. Will it be good idea to make a single responsive UI that works best on both desktop browser and mobile browser and make app. OR we should make different development for browser and mobile app.

推荐答案

为了扩展已经说过的内容,Ionic是为移动设备而构建和测试的。例如,Internet Explorer未经过测试,无法正确处理Ionic中的许多功能。桌面浏览器确实具有与移动浏览器对应的不同功能。您会严重限制可以在桌面上使用您的应用程序的浏览器。

To expand a little bit on what has already been said, Ionic is is built and tested for mobile only. Internet Explorer for example is not tested and does not properly handle a number of the features in Ionic. Desktop browsers do have different features from their mobile browser counterparts. You would seriously limit the browsers that can use your application on a desktop.

最有可能的是,您应该为桌面和移动设备提供两种不同的应用程序。除非您有胆量或能力告诉用户他们必须使用Chrome(或Opera)来运行您的网站,否则您需要两个单独的应用程序。您仍然可以将Ionic用于移动网站,但无法使用Cordova的完整平台集成(您将仅限于浏览器提供的本机HTML API)。您当然可以将大部分业务逻辑保留在两个应用程序之间共享的公共核心中。这将需要创建一个共享的角度模块。我在一个带有Ionic应用程序和普通Angular桌面应用程序(使用Bootstrap)的项目中完成了这项工作。

Most likely, you should provide two different applications for desktop and mobile. Unless you have the guts or ability to tell your users that they must use Chrome (or Opera) to run your website, you'll want two separate applications. You could still use Ionic for a mobile website though, but without being able to use Cordova's full platform integration (you would be limited to the native HTML APIs provided by the browser). You could certainly retain much of your business logic in a common core that is shared between both applications. That would require creating a shared angular module(s). I have done this in a project with an Ionic app and a normal Angular desktop app (with Bootstrap).

有很多方法可以检测访问者是否会来从桌面或移动设备。我不知道100%完美的方法,因为它们通常依赖于浏览器的用户代理字符串(并且可以被欺骗,更改等)。有关如何在服务器或服务器上实现移动检测的一些常见脚本或示例,请参见 http://detectmobilebrowsers.com/ 编程语言。

There are a number of ways to detect if a visitor is coming from a desktop or mobile device. I don't know of a method that is 100% perfect, because they usually rely on the browser's user agent string (and can be spoofed, changed, etc). See http://detectmobilebrowsers.com/ for some common scripts or examples how to implement mobile detection on a server or in a programming language.

这篇关于使用离子作为桌面Web应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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