简体   繁体   English

使用MEAN angularjs Nodejs堆栈的Phonegap客户端

[英]Phonegap clients using MEAN angularjs Nodejs Stack

I am developing Web Application using MEAN(Mongo, Express, Angular, Node) JS stack. 我正在使用MEAN(Mongo,Express,Angular,Node)JS堆栈开发Web应用程序。

I would like to use PhoneGap to compile my clients for Android/iphone native app. 我想使用PhoneGap来为Android / iphone本机应用程序编译客户端。 At the same time I want to keep same client-side Views & AngularJS code to remain usable for desktop browsers. 同时,我想保留相同的客户端Views和AngularJS代码,以使其仍可用于桌面浏览器。 I am using bootstrapper for Responsive design and it works fine for me on mobile browsers. 我正在使用Bootstrapper进行响应式设计,并且在移动浏览器上对我来说效果很好。

I saw, Phonegap require us to include some of it's own Javascript files, and I will be required to have few more .js files in footer of index.html. 我看到,Phonegap要求我们包括一些它自己的Javascript文件,并且在index.html的页脚中将需要更多的.js文件。

  • If I pressume, I should not be using server side .jade engine for index.html file, and all my .html should remain in client side. 如果我按时,则不应该对index.html文件使用服务器端.jade引擎,而我的所有.html应该保留在客户端中。
  • will index.html created for phoneGap will cause problem, if I use it for desktop browser? 如果将其用于桌面浏览器,为phoneGap创建的index.html会引起问题吗? Should I have different index.html for browser and phoneGap input. 我应该为浏览器和phoneGap输入使用不同的index.html吗? Can grunt help me in customizing index.html files. 可以帮助我定制index.html文件。

What are the other things which I should take care of for my needs? 我还需要注意哪些其他事项?

My advice for you is to separate the projects, Phonegap or Cordova Apps doesn't have a running server, they serve the html files through the file:// protocol. 我的建议是将项目分开,Phonegap或Cordova Apps没有正在运行的服务器,它们通过file://协议提供html文件。

If I pressume, I should not be using server side .jade engine for index.html file, and all my .html should remain in client side. 如果我按时,则不应该对index.html文件使用服务器端.jade引擎,而我的所有.html应该保留在客户端中。

You presumed correctly, no .jade templates should be used, your views should be plain html files or, if you want, load them as scripts so you don't have to load them on page request increasing app performance. 您可以正确地假设,不应该使用.jade模板,视图应该是纯html文件,或者,如果需要,可以将它们作为脚本加载,这样就不必在页面上加载它们来提高应用程序性能。

will index.html created for phoneGap will cause problem, if I use it for desktop browser? 如果将其用于桌面浏览器,为phoneGap创建的index.html会引起问题吗? Should I have different index.html for browser and phoneGap input. 我应该为浏览器和phoneGap输入使用不同的index.html吗? Can grunt help me in customizing index.html files. 可以帮助我定制index.html文件。

Yes it will, if you try to use an index,html from phonegap on a desktop browser you will get a lot of javascript alerts. 是的,如果您尝试在桌面浏览器上使用phonegap中的index,html,您将收到很多javascript警报。 Since phonegap.js is expecting to get some events that are fired by cordova when running on the device. 由于phonegap.js期望在设备上运行时获得由cordova触发的一些事件。 And this gets worse if you have Cordova plugins. 如果您有Cordova插件,这会变得更糟。

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

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