1

I'm using PHP to generate JSON from data retrieved from a MySQL database. If the user isn't logged in, they automatically get redirected to a login page using:

header('location: http://domain.com/')

I am using AngularJS to retrieve and handle all this data. I'm using $http.get to get the JSON code:

$http.get('tasksjson.php').success(function(data){..}

Here's the problem though, if the user isn't logged in the user doesn't get redirected, instead Angular just uses what it gets as JSON code. Is there anyway to get AngularJS to redirect me to a page?

iSNSD09
  • 21
  • 3

0 Answers0