I want to display an alert message status if I lose an internet connection
<p>Using AngularJS, how can I display an alert message status if I lose an internet connection in my app?</p>

<p>I am working on Angularjs Express framework and APIs.
while working on app if I lose internet connection I need to pop up an alert and I should stop calling HTTP requests until I receive a proper internet connection and resume the work. </p>

<p>I even tried with offline.js am not able to solve please if any simple and easy method is there let me know thank you. In header I added all these</p>

<pre><code>&lt;script src="/javascripts/plugins/offlinechecking/offline.min.js"&gt;&lt;/script&gt;
&lt;link rel="stylesheet" href="/stylesheets/themes/offline-theme-chrome.css" /&gt;
&lt;link rel="stylesheet" href="/stylesheets/themes/offline-language-english.css" /&gt;
&lt;script&gt;
  Offline.options = {
    checkOnLoad: false,
    interceptRequests: true,
    reconnect: {
      initialDelay: 3,
      delay: (1.5 * last delay, capped at 1 hour)
    },
    requests: true,
    game: false
&lt;/script&gt;
</code></pre>