res = \CRM_Core_Resources::singleton(); $this->angular = \Civi::service('angular'); $this->region = \CRM_Utils_Request::retrieve('snippet', 'String') ? 'ajax-snippet' : 'html-header'; } /** * This function takes care of all the things common to all * pages. This typically involves assigning the appropriate * smarty variable :) * * @return string * The content generated by running this page */ public function run() { $this->registerResources(); return parent::run(); } /** * Register resources required by Angular. */ public function registerResources() { $loader = new \Civi\Angular\AngularLoader(); $loader->setPageName('civicrm/a'); $loader->useApp([ 'activeRoute' => \CRM_Utils_Request::retrieve('route', 'String'), 'defaultRoute' => NULL, ]); $loader->load(); } }