AngularJS 2 的多平台开发
Multiplatform development with AngularJS 2
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、本机移动和本机桌面应用程序的相同代码库的示例。此外,Ionic Framework 是为本机移动应用程序制作的,不应该用于 Web 和桌面应用程序,因此应该有两种不同的视图,一种是 Ionic,另一种是 Bootstrap/Foundation/insert your favorite CSS framework here
.
是否可以为网络、移动网络、本机移动和本机桌面编写单个 AngularJS 应用程序,所有这些应用程序都具有相同的代码库?如果是,如何?如果没有,我如何重用代码(与视图无关的所有内容)来实现这一点,同时按目标平台维护单个项目?
这是一个相当古老的问题,但是对于那些仍然对这个话题感兴趣的人:
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/
我还没有尝试过它们,所以我无法评论它们的实际可用性。
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、本机移动和本机桌面应用程序的相同代码库的示例。此外,Ionic Framework 是为本机移动应用程序制作的,不应该用于 Web 和桌面应用程序,因此应该有两种不同的视图,一种是 Ionic,另一种是 Bootstrap/Foundation/insert your favorite CSS framework here
.
是否可以为网络、移动网络、本机移动和本机桌面编写单个 AngularJS 应用程序,所有这些应用程序都具有相同的代码库?如果是,如何?如果没有,我如何重用代码(与视图无关的所有内容)来实现这一点,同时按目标平台维护单个项目?
这是一个相当古老的问题,但是对于那些仍然对这个话题感兴趣的人:
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/
我还没有尝试过它们,所以我无法评论它们的实际可用性。