Navaneethan Arun
Navaneethan Arun

Reputation: 386

How to detect Internet Unavailable in angularjs

When my application url load in browser, if internet is unavailable i need alert message or any error prompt show to user that 'Internet unavailable'.If internet is available it run the application. Please anyone help me to fix this issue

Upvotes: 0

Views: 72

Answers (1)

John Doe
John Doe

Reputation: 506

I suggest you to write interceptor, and check it there

if (!window.navigator.onLine) {
 // youre code
}

Upvotes: 1

Related Questions