angular - 使用 AngularJS 2 进行多平台开发

标签 angular mobile web-applications ionic-framework desktop-application

AngularJS website状态:

Develop Across All Platforms

Learn one way to build applications with Angular and reuse your code and abilities to build apps for any deployment target. For web, mobile web, native mobile and native desktop.

根据我的测试,Ionic Framework(基于 Angular 2)允许使用相同的代码库创建 iOS、Android 和 Windows Phone 应用程序,但我从未见过任何用于 Web、移动 Web、原生代码库的示例移动和 native 桌面应用程序。此外,Ionic Framework 是为 native 移动应用程序制作的,不应该用于 Web 和桌面应用程序,因此应该有两种不同的 View ,一种是 Ionic,另一种是 Bootstrap/Foundation/在这里插入你最喜欢的 CSS 框架.

是否有可能为网络、移动网络、原生移动和原生桌面编写一个单一的 AngularJS 应用程序,所有这些都具有相同的代码库?如果是,如何?如果没有,我如何重用代码(与 View 无关的所有内容)来实现这一点,同时按目标平台维护单个项目?

最佳答案

这是一个相当古老的问题,但是对于那些仍然对这个话题感兴趣的人:

https://jlooper.github.io/angular-starter/

The Angular Multi-Platform Starter is a template for building apps that run across the web, native mobile (using NativeScript), and for desktop (using Electron).

这里有一个替代方案:

https://github.com/NathanWalker/angular-seed-advanced

这篇文章的特色:

https://developer.telerik.com/featured/building-angular-2-web-native-apps-single-codebase/

我还没有尝试过它们,所以我无法评论它们的实际可用性。

关于angular - 使用 AngularJS 2 进行多平台开发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40455771/

相关文章:

html - 移动网络应用程序的推送通知工具

events - Google 日历事件按钮 - 移动版

ios - 有没有办法将 Touch ID 与 iOS Keychain 一起使用,但不提示输入用户密码?

javascript - 谷歌浏览器 "Application Shortcut": How to auto-load JavaScript?

javascript - 如何在不害怕的情况下更新 JavaScript 库?

python - 从 Flask 中的 protected 路径执行另一个脚本是否安全?

javascript - 我的农业网格没有显示任何数据

Angular 设置 HTTP 超时

javascript - 从 Angular-Redux 商店获取最新状态

javascript - 使用 Ionic 4 Angular Fire Auth 防护进行无限 console.logging