How to use the linux terminal through angular2

此生再无相见时 提交于 2019-12-12 02:14:39

问题


I am new with Angular 2 and I wonder if there is any method in angular 2 that I could use the terminal of my Linux (Raspbian). Something like to a method in php, when we use the : system("any command in the terminal");


回答1:


In short: no you cannot. Angular is UI framework, that is executed in browser/client side, i.e. it has nothing to do with your server code (Rapsberry). All you can do: make endpoint on backend, that will execute command if http request made. Unless you are using some javascript server on backend (node/meteor), but again it has nothing to do with Angular itself and you have to read documentation of your server.

If your target is executing command line on client side, so answer is still "no you cannot", as browser is isolated from other system and there is no way to execute any system commands from browser.



来源:https://stackoverflow.com/questions/41636900/how-to-use-the-linux-terminal-through-angular2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!