将TypeScript + NW.JS + Angular.JS用于基于桌面的应用程序是一个好主意 [英] is it a good idea to use TypeScript + NW.JS + Angular.JS for Desktop based app

查看:280
本文介绍了将TypeScript + NW.JS + Angular.JS用于基于桌面的应用程序是一个好主意的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们

我将要启动一个基于Node-Webkit(nw.js)的新桌面应用程序.我正计划将angular用于其众所周知的功能.想更多地了解在同一项目中使用TypeScript的可能性.我的应用程序将使用很少的节点程序包(包括用C ++编写的自定义程序包)与OS进行大量交互.此外,该应用程序需要支持Mac和Windows,并且需要通过Internet进行分发.
由于我对JS世界还比较陌生,请提供一些专家意见.


谢谢
Vashisth

Hi Guys

I am about to start a new desktop app based on Node-Webkit(nw.js). I am planning to use angular for its well known capability. wanted to know more about the possibility of using TypeScript in same project. My App is going to use few node packages(including custom packages written in C++) to interact heavily with OS. Moreover the app need to support mac and windows and need to be distributed over internet.
As i am relatively new to JS world, please provide some expert comments.


Thanks
Vashisth

推荐答案

感谢您的澄清.在您解释了目的之后,我可以看到您的大部分建议都没有意义.使用类System.Net.HttpWebRequest或简化的类System.Net.WebClient下载文件:
https://msdn.microsoft.com/zh-我们/library/system.net.httpwebrequest%28v=vs.110%29.aspx [ https://msdn.microsoft.com/zh-我们/library/system.net.webclient%28v=vs.110%29.aspx [ Html Agility Pack ,但我不这样做.真的认为确实需要使用复杂的 Web抓取技术来寻找不同的URL,因为这些网站是您的,所以您可以直接(在任何合适的资源中)交付客户端需要用于下载的URL.

下载文件时,可能需要查看其中的一些文件,因此需要使用某些Web浏览器来查看HTML文件,但是WebKit可能会显得过头了.为此,您可以使用任何WebBrowser组件.在桌面应用程序中对JavaScript,TypeScript和Angular.JS的任何特定用法听起来对我来说都是荒谬的.如果我错过了任何事情,我将不胜感激您的解释.

—SA
Thank you for the clarification. After you explained the purpose, I can see that I see no sense in most of what you suggested. The files are downloaded using the class System.Net.HttpWebRequest or simplified class System.Net.WebClient:
https://msdn.microsoft.com/en-us/library/system.net.httpwebrequest%28v=vs.110%29.aspx[^],
https://msdn.microsoft.com/en-us/library/system.net.webclient%28v=vs.110%29.aspx[^].

If you needed to parse downloaded HTML files, I would advise using some HTML parser, first of all, Html Agility Pack, but I don''t really think that sophisticated Web scraping techniques uses for hunting for different URLs will really be needed, because the sites are yours, so you could directly deliver (in any suitable resource) the URLs you client needs to use for downloading.

When you download the files, you may need to view some of them, so some Web browser would be needed to view, for example, HTML file, but WebKit could be an overkill. You can use any WebBrowser component for this purpose. And any specific use of JavaScript, TypeScript, Angular.JS sounds in a desktop application sound pretty much like absurd to me. If I missed something, I''ll be grateful for your explanations.

—SA


这篇关于将TypeScript + NW.JS + Angular.JS用于基于桌面的应用程序是一个好主意的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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