$http.get("check_login.php")
.success(function(response) {
if(response.login == 1 || response.login == 2) {
window.location.href = 'new.html';
event.preventDefault();
}
if(response.login == 0 || response.login == undefined) {
window.location.href = 'index.html';
event.preventDefault();
}
});
I think you should learn about routing
in AngularJs
, please go through these links.
http://www.w3schools.com/angular/angular_routing.asp
https://scotch.io/tutorials/single-page-apps-with-angularjs-routing-and-templating