title: Ionic authentication for login with angularjs
body: <p>As ionic uses angularjs, for login system there isn't any browser to save cookie or session in order to authenticate for each part of application.
  One way is protecting by using this in <code>app.js</code>:</p>
  
  <pre><code>$urlRouterProvider.otherwise('/login');
  </code></pre>
  
  <p>Because any one doesn't access to other links into application. When returned answer from server (mysql database) is <strong>true</strong> , we can use this:</p>
  
  <pre><code>$state.go('app.main');
  </code></pre>
  
  <p>Is this a good idea? Or any other ways?</p>