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")
})
};
}]);
請看看如何[ngRoute(https://開頭的文檔。 angularjs.org/api/ngRoute)的作品..! –
你的問題是什麼? – hurricane
你使用ngRoute還是uiRouter? – akinjide