2017-02-13 47 views
1
angular.module('myApp') 
    .controller('LoginCtrl', ['$scope', '$http', function($scope, $http) {   

     $scope.getlogin = function(){ 
      $http.get("api/business/getlogin/"+$scope.login.user+"/"+$scope.login.password) 
      .success(function(data){ 
       if(data.length != 0){ 

        /*templateUrl: 'new.html' 
        controller:'NewCtrl'*/ 

        $window.location.href ='new.html' 
        alert("user foubd") 
       } 
       else 
        alert("user not found") 
      }) 
     }; 
}]); 
+1

请看看如何[ngRoute(https://开头的文档。 angularjs.org/api/ngRoute)的作品..! –

+0

你的问题是什么? – hurricane

+0

你使用ngRoute还是uiRouter? – akinjide

回答

1

使用 “window.location.href” 而不是 “$ window.location.href”

只需删除$

相关问题