问题
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