不在以下网址中工作?

时间:2017-02-13 07:12:09

标签: angularjs

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 个答案:

答案 0 :(得分:1)

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

只需删除$

即可