title: Show pages according to url AngularJs
body: <p>I am making a Angular project with Spring MVC.</p>
  
  <p>What I need to do is get the parameter from url and show the pages accordingly.</p>
  
  <p>For example :</p>
  
  <pre><code>cms.example.com -- &gt; so it will go to the cms signup/login page
  
  login.example.com ---&gt;  so it will go to the only login page
  
  somename.example.com ---&gt;  so it will go to the login page but with parameter somename
  </code></pre>
  
  <p>Since Angular is a SPA(Single Page Application) I made a controller which fetches the full url and returns</p>
  
  <pre><code>cms.controller('homeController', function($scope, $http,  $window) { 
      var y =  window.location.host.split('.');
      var z = y[0];
  
      if ( z == "cms" )
      {
          $scope.logincms = z;
          //console.log($scope.logincms);
      }
      else if ( z == "login" )
      {
          $scope.logincms = z;
          //console.log($scope.logincms);
      }
      else
      {  //404 or success page  }         
  });
  </code></pre>
  
  <p>and used ng-if in html page like if it equals <code>login</code> then it will show login html, if it is <code>cms</code> then it will show login/signup page. <strong>BUT</strong></p>
  
  <p>I have seen a website cliniko.com. There they make the same kind of app but I didn't see any ng-if in their html. Just wondering how they do it or is there another way to do it?</p>