javascript - redirect login page to welcome page from angularjs -


i creating s web app in need redirect login welcome page if user id , password validated

    <script>     var app = angular.module('myapp', []);     app.controller('customersctrl', function ($scope, $http, $interval) {         //login         $scope.loginbutton = function () {             $http.get('/login.asmx/loginuser', {                 params: {                     log: $scope.log,                     pm: $scope.pm,                     password: $scope.password                 }             })             .then(function (response) {                 {                    //here want redirect page                 }             })         }     }); </script> 

this script of angularjs how redirect page page?

add $window in controller

app.controller('customersctrl', function ($scope, $http, $interval, $location, $window) { 

then add following line in response

.then(function (response) {                     {                         $window.location.href = "../welcome/index";                     }                 }) 

Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -