$headOffset = 0;
$config = \CRM_Core_Config::singleton();
if ($config->debug) {
+ $res->addScriptFile('civicrm', 'ang/resetLocationProviderHashPrefix.js', 101, $this->getRegion(), FALSE);
foreach ($moduleNames as $moduleName) {
foreach ($this->angular->getResources($moduleName, 'css', 'cacheUrl') as $url) {
$res->addStyleUrl($url, self::DEFAULT_MODULE_WEIGHT + (++$headOffset), $this->getRegion());
case 'angular-modules.js':
$moduleNames = $page->parseModuleNames($event->params['modules'] ?? NULL, $angular);
$event->mimeType = 'application/javascript';
- $event->content = $page->digestJs($angular->getResources($moduleNames, 'js', 'path'));
+ $files = array_merge(
+ [\Civi::resources()->getPath('civicrm', 'ang/resetLocationProviderHashPrefix.js')],
+ $angular->getResources($moduleNames, 'js', 'path')
+ );
+ $event->content = $page->digestJs($files);
break;
case 'angular-modules.css':
// modules should depend on it.
var crmApp = angular.module('crmApp', CRM.angular.modules);
- // dev/core#1818 use angular 1.5 default of # instead of 1.6+ default of #!
- crmApp.config(['$locationProvider', function($locationProvider) {
- $locationProvider.hashPrefix("");
- }]);
-
crmApp.config(['$routeProvider',
function($routeProvider) {
--- /dev/null
+(function(angular, $, _) {
+
+ // dev/core#1818 use angular 1.5 default of # instead of 1.6+ default of #!
+ angular.module('ng')
+ .config(['$locationProvider', function($locationProvider) {
+ $locationProvider.hashPrefix('');
+ }]);
+
+})(angular, CRM.$, CRM._);