Check Connection with the API in real time AngularJS

0

I know you can check for an internet connection, but you could check if my application is connected to the API where both are on the local network.

For example, if a problem occurs on the network and the application can not communicate with the API, a message would appear informing the user about the situation.

What would be the steps to get this result?

    
asked by anonymous 16.11.2015 / 17:58

1 answer

1

The ideal would be to 'ping' the api at a pre-set time interval of about 10 sec.

I've used it that way.

In case the ping returns an error we inform the user.

    
16.11.2015 / 18:17