You are here

function angularjs_page_delivery_callback_alter in AngularJS 7

Implements hook_page_delivery_callback_alter().

File

./angularjs.module, line 8

Code

function angularjs_page_delivery_callback_alter(&$callback) {

  // pjax requests can be detected by the X-PJAX http header.
  // When serving pjax requests, deliver just the main page content.
  if (!empty($_SERVER['HTTP_X_ANGULARJS']) && $callback == 'drupal_deliver_html_page') {
    $callback = 'angularjs_deliver_page_content';
  }
}