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
Post a Comment