To get Yii to set
yii::app()->request->isAjaxRequest
From AngularJS I had to add a header ‘X-Requested-With’ : ‘XMLHttpRequest’
$http(
{
method: 'GET',
url: url,
headers: {
'Content-type': 'application/json',
'X-Requested-With' : 'XMLHttpRequest' // Needed by Yii to look at it as ajax request.
}
}).
success(function(data, status, headers, config) {
If anyone knows of a better way please share.