title: How to redirect to other page after successful login in angularjs?
body: <p>Hi I am developing one application in angularjs as front end and web api2 as backend. I am new to both angular and web api. I have completed login page in angularjs. As soon as my login successful i want to go to page called Index.cshtml located at Views/Home/index.cshtml. I am trying as below.</p>
  
  <p>This is my controller code.</p>
  
  <pre><code>app.controller('Login', function ($scope, LoginService) {
      $scope.Login = function () {
          var sub = {
              User_Name: $scope.User_Name,
              User_Password: $scope.User_Password
          };
          var checkData = LoginService.Login(sub);
          checkData.then(function (data) {
              //want redirection
              var url = '/Home/Index/';
              window.location = url;
              }, function (error) {
              })
          };
  });
  </code></pre>
  
  <p>This is my module.js</p>
  
  <pre><code>var app;
  (function () {
      app = angular.module("Login", []);
  })();
  </code></pre>
  
  <p>service.js</p>
  
  <pre><code>app.service("LoginService", function ($http) {
      this.Login = function (sub) {
          var credentials = { User_Name: sub.User_Name, User_Password: sub.User_Password };
             $http.post('api/NCT_UsersLogin/', credentials).success(function (response) {  });
      }
  });
  </code></pre>
  
  <p>I am trying using window.location but it is not working. May I get some help here? Any help would be appreciated. Thank you.</p>