0

Is there an Angular2+ equivalent to java's system.exit()? I am wanting to create a button on my app that stops running the code, but can't find something similar.

Petlover620
  • 115
  • 1
  • 11
  • What do you mean by "stops running the code"? This is an application hosted on a server somewhere, not something running on your laptop. – Roddy of the Frozen Peas Jul 07 '20 at 19:32
  • 3
    this seems like a strange request for a webapp. what specific behavior do you want to stop when the user clicks the button? what does the user see after they click the button? – Dan O Jul 07 '20 at 19:32
  • And more importantly, what do _other users_ see after your first user clicks the button? – Roddy of the Frozen Peas Jul 07 '20 at 19:32
  • What I mean by "stops running the code" is quitting the app and closing the browser. For example, if a user is finished using the app, the browser will close. Is there a way to do this? – Petlover620 Jul 07 '20 at 19:40

1 Answers1

0

If you are asking in terms of closing your Angular program so here it will be like closing your tab

System.exit equivalent is window.close or just close but we have issues with them

we can only close tabs which we have opened programmatically

Dharman
  • 30,962
  • 25
  • 85
  • 135
hanan
  • 1,768
  • 1
  • 14
  • 19