title: How to check user has internet connection, using angularJs
body: <p>When an user attempts to log in without Internet connection, I just need to check whether he/she is connected to internet or not.</p>
  
  <p>I tried the following code :</p>
  
  <pre><code>if (status == '404') {
      $scope.error="No internet connection";
      return false;
  }
  </code></pre>
  
  <p>But this status 404 comes even when my Web Service failed to connect. I need to differentiate both, if is the user's internet connection issue or the Web Service connection issue. </p>