Angular - cleanup core angular module declarations
authorcolemanw <coleman@civicrm.org>
Tue, 7 Nov 2023 20:51:22 +0000 (15:51 -0500)
committercolemanw <coleman@civicrm.org>
Wed, 8 Nov 2023 02:11:24 +0000 (21:11 -0500)
108 files changed:
CRM/Case/Info.php
CRM/Core/Component/Info.php
CRM/Mailing/Info.php
Civi/Angular/Manager.php
ext/civi_case/ang/crmCaseType.ang.php [moved from ang/crmCaseType.ang.php with 60% similarity]
ext/civi_case/ang/crmCaseType.css [moved from ang/crmCaseType.css with 100% similarity]
ext/civi_case/ang/crmCaseType.js [moved from ang/crmCaseType.js with 100% similarity]
ext/civi_case/ang/crmCaseType/activityTypesTable.html [moved from ang/crmCaseType/activityTypesTable.html with 100% similarity]
ext/civi_case/ang/crmCaseType/caseTypeDetails.html [moved from ang/crmCaseType/caseTypeDetails.html with 100% similarity]
ext/civi_case/ang/crmCaseType/edit.html [moved from ang/crmCaseType/edit.html with 100% similarity]
ext/civi_case/ang/crmCaseType/list.html [moved from ang/crmCaseType/list.html with 100% similarity]
ext/civi_case/ang/crmCaseType/rolesTable.html [moved from ang/crmCaseType/rolesTable.html with 100% similarity]
ext/civi_case/ang/crmCaseType/sequenceTable.html [moved from ang/crmCaseType/sequenceTable.html with 100% similarity]
ext/civi_case/ang/crmCaseType/statusTable.html [moved from ang/crmCaseType/statusTable.html with 100% similarity]
ext/civi_case/ang/crmCaseType/timelineTable.html [moved from ang/crmCaseType/timelineTable.html with 100% similarity]
ext/civi_case/info.xml
ext/civi_mail/ang/crmMailing.ang.php [moved from ang/crmMailing.ang.php with 80% similarity]
ext/civi_mail/ang/crmMailing.css [moved from ang/crmMailing.css with 100% similarity]
ext/civi_mail/ang/crmMailing.js [moved from ang/crmMailing.js with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockApprove.html [moved from ang/crmMailing/BlockApprove.html with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockApprove.js [moved from ang/crmMailing/BlockApprove.js with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockHeaderFooter.html [moved from ang/crmMailing/BlockHeaderFooter.html with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockHeaderFooter.js [moved from ang/crmMailing/BlockHeaderFooter.js with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockMailing.html [moved from ang/crmMailing/BlockMailing.html with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockMailing.js [moved from ang/crmMailing/BlockMailing.js with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockPreview.html [moved from ang/crmMailing/BlockPreview.html with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockPreview.js [moved from ang/crmMailing/BlockPreview.js with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockPublication.html [moved from ang/crmMailing/BlockPublication.html with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockPublication.js [moved from ang/crmMailing/BlockPublication.js with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockRecipients.html [moved from ang/crmMailing/BlockRecipients.html with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockRecipients.js [moved from ang/crmMailing/BlockRecipients.js with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockRecipientsMultiline.html [moved from ang/crmMailing/BlockRecipientsMultiline.html with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockRecipientsMultiline.js [moved from ang/crmMailing/BlockRecipientsMultiline.js with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockResponses.html [moved from ang/crmMailing/BlockResponses.html with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockResponses.js [moved from ang/crmMailing/BlockResponses.js with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockReview.html [moved from ang/crmMailing/BlockReview.html with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockReview.js [moved from ang/crmMailing/BlockReview.js with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockSchedule.html [moved from ang/crmMailing/BlockSchedule.html with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockSchedule.js [moved from ang/crmMailing/BlockSchedule.js with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockSummary.html [moved from ang/crmMailing/BlockSummary.html with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockSummary.js [moved from ang/crmMailing/BlockSummary.js with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockTemplates.html [moved from ang/crmMailing/BlockTemplates.html with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockTemplates.js [moved from ang/crmMailing/BlockTemplates.js with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockTracking.html [moved from ang/crmMailing/BlockTracking.html with 100% similarity]
ext/civi_mail/ang/crmMailing/BlockTracking.js [moved from ang/crmMailing/BlockTracking.js with 100% similarity]
ext/civi_mail/ang/crmMailing/BodyHtml.html [moved from ang/crmMailing/BodyHtml.html with 100% similarity]
ext/civi_mail/ang/crmMailing/BodyHtml.js [moved from ang/crmMailing/BodyHtml.js with 100% similarity]
ext/civi_mail/ang/crmMailing/BodyText.html [moved from ang/crmMailing/BodyText.html with 100% similarity]
ext/civi_mail/ang/crmMailing/BodyText.js [moved from ang/crmMailing/BodyText.js with 100% similarity]
ext/civi_mail/ang/crmMailing/CreateMailingCtrl.js [moved from ang/crmMailing/CreateMailingCtrl.js with 100% similarity]
ext/civi_mail/ang/crmMailing/EditMailingCtrl.js [moved from ang/crmMailing/EditMailingCtrl.js with 100% similarity]
ext/civi_mail/ang/crmMailing/EditMailingCtrl/2step.html [moved from ang/crmMailing/EditMailingCtrl/2step.html with 100% similarity]
ext/civi_mail/ang/crmMailing/EditMailingCtrl/base.html [moved from ang/crmMailing/EditMailingCtrl/base.html with 100% similarity]
ext/civi_mail/ang/crmMailing/EditMailingCtrl/unified.html [moved from ang/crmMailing/EditMailingCtrl/unified.html with 100% similarity]
ext/civi_mail/ang/crmMailing/EditMailingCtrl/unified2.html [moved from ang/crmMailing/EditMailingCtrl/unified2.html with 100% similarity]
ext/civi_mail/ang/crmMailing/EditMailingCtrl/wizard.html [moved from ang/crmMailing/EditMailingCtrl/wizard.html with 100% similarity]
ext/civi_mail/ang/crmMailing/EditMailingCtrl/workflow.html [moved from ang/crmMailing/EditMailingCtrl/workflow.html with 100% similarity]
ext/civi_mail/ang/crmMailing/EditRecipCtrl.js [moved from ang/crmMailing/EditRecipCtrl.js with 100% similarity]
ext/civi_mail/ang/crmMailing/EditRecipOptionsDialogCtrl.html [moved from ang/crmMailing/EditRecipOptionsDialogCtrl.html with 100% similarity]
ext/civi_mail/ang/crmMailing/EditRecipOptionsDialogCtrl.js [moved from ang/crmMailing/EditRecipOptionsDialogCtrl.js with 100% similarity]
ext/civi_mail/ang/crmMailing/EditUnsubGroupCtrl.js [moved from ang/crmMailing/EditUnsubGroupCtrl.js with 100% similarity]
ext/civi_mail/ang/crmMailing/EmailAddrCtrl.js [moved from ang/crmMailing/EmailAddrCtrl.js with 100% similarity]
ext/civi_mail/ang/crmMailing/EmailBodyCtrl.js [moved from ang/crmMailing/EmailBodyCtrl.js with 100% similarity]
ext/civi_mail/ang/crmMailing/EmailBodyCtrl/tokenAlert.html [moved from ang/crmMailing/EmailBodyCtrl/tokenAlert.html with 100% similarity]
ext/civi_mail/ang/crmMailing/FromAddress.js [moved from ang/crmMailing/FromAddress.js with 100% similarity]
ext/civi_mail/ang/crmMailing/ListMailingsCtrl.js [moved from ang/crmMailing/ListMailingsCtrl.js with 100% similarity]
ext/civi_mail/ang/crmMailing/MsgTemplateCtrl.js [moved from ang/crmMailing/MsgTemplateCtrl.js with 100% similarity]
ext/civi_mail/ang/crmMailing/PreviewComponentCtrl.js [moved from ang/crmMailing/PreviewComponentCtrl.js with 100% similarity]
ext/civi_mail/ang/crmMailing/PreviewComponentDialogCtrl.html [moved from ang/crmMailing/PreviewComponentDialogCtrl.html with 100% similarity]
ext/civi_mail/ang/crmMailing/PreviewComponentDialogCtrl.js [moved from ang/crmMailing/PreviewComponentDialogCtrl.js with 100% similarity]
ext/civi_mail/ang/crmMailing/PreviewMailingDialogCtrl.js [moved from ang/crmMailing/PreviewMailingDialogCtrl.js with 100% similarity]
ext/civi_mail/ang/crmMailing/PreviewMgr/full.html [moved from ang/crmMailing/PreviewMgr/full.html with 100% similarity]
ext/civi_mail/ang/crmMailing/PreviewMgr/html.html [moved from ang/crmMailing/PreviewMgr/html.html with 100% similarity]
ext/civi_mail/ang/crmMailing/PreviewMgr/text.html [moved from ang/crmMailing/PreviewMgr/text.html with 100% similarity]
ext/civi_mail/ang/crmMailing/PreviewRecipCtrl.html [moved from ang/crmMailing/PreviewRecipCtrl.html with 100% similarity]
ext/civi_mail/ang/crmMailing/PreviewRecipCtrl.js [moved from ang/crmMailing/PreviewRecipCtrl.js with 100% similarity]
ext/civi_mail/ang/crmMailing/RadioDate.js [moved from ang/crmMailing/RadioDate.js with 100% similarity]
ext/civi_mail/ang/crmMailing/ReviewBool.js [moved from ang/crmMailing/ReviewBool.js with 100% similarity]
ext/civi_mail/ang/crmMailing/SaveMsgTemplateDialogCtrl.html [moved from ang/crmMailing/SaveMsgTemplateDialogCtrl.html with 100% similarity]
ext/civi_mail/ang/crmMailing/SaveMsgTemplateDialogCtrl.js [moved from ang/crmMailing/SaveMsgTemplateDialogCtrl.js with 100% similarity]
ext/civi_mail/ang/crmMailing/Templates.js [moved from ang/crmMailing/Templates.js with 100% similarity]
ext/civi_mail/ang/crmMailing/Token.js [moved from ang/crmMailing/Token.js with 100% similarity]
ext/civi_mail/ang/crmMailing/ViewRecipCtrl.js [moved from ang/crmMailing/ViewRecipCtrl.js with 100% similarity]
ext/civi_mail/ang/crmMailing/crmMailingRecipientsAutocomplete.component.js [moved from ang/crmMailing/crmMailingRecipientsAutocomplete.component.js with 100% similarity]
ext/civi_mail/ang/crmMailing/services.js [moved from ang/crmMailing/services.js with 100% similarity]
ext/civi_mail/ang/crmMailingAB.ang.php [moved from ang/crmMailingAB.ang.php with 67% similarity]
ext/civi_mail/ang/crmMailingAB.css [moved from ang/crmMailingAB.css with 100% similarity]
ext/civi_mail/ang/crmMailingAB.js [moved from ang/crmMailingAB.js with 100% similarity]
ext/civi_mail/ang/crmMailingAB/BlockMailing.html [moved from ang/crmMailingAB/BlockMailing.html with 100% similarity]
ext/civi_mail/ang/crmMailingAB/BlockMailing.js [moved from ang/crmMailingAB/BlockMailing.js with 100% similarity]
ext/civi_mail/ang/crmMailingAB/BlockSetup.html [moved from ang/crmMailingAB/BlockSetup.html with 100% similarity]
ext/civi_mail/ang/crmMailingAB/BlockSetup.js [moved from ang/crmMailingAB/BlockSetup.js with 100% similarity]
ext/civi_mail/ang/crmMailingAB/EditCtrl.js [moved from ang/crmMailingAB/EditCtrl.js with 100% similarity]
ext/civi_mail/ang/crmMailingAB/EditCtrl/edit.html [moved from ang/crmMailingAB/EditCtrl/edit.html with 100% similarity]
ext/civi_mail/ang/crmMailingAB/EditCtrl/main.html [moved from ang/crmMailingAB/EditCtrl/main.html with 100% similarity]
ext/civi_mail/ang/crmMailingAB/EditCtrl/report.html [moved from ang/crmMailingAB/EditCtrl/report.html with 100% similarity]
ext/civi_mail/ang/crmMailingAB/ListCtrl.html [moved from ang/crmMailingAB/ListCtrl.html with 100% similarity]
ext/civi_mail/ang/crmMailingAB/ListCtrl.js [moved from ang/crmMailingAB/ListCtrl.js with 100% similarity]
ext/civi_mail/ang/crmMailingAB/NewCtrl.js [moved from ang/crmMailingAB/NewCtrl.js with 100% similarity]
ext/civi_mail/ang/crmMailingAB/ReportCtrl.js [moved from ang/crmMailingAB/ReportCtrl.js with 100% similarity]
ext/civi_mail/ang/crmMailingAB/Slider.html [moved from ang/crmMailingAB/Slider.html with 100% similarity]
ext/civi_mail/ang/crmMailingAB/Slider.js [moved from ang/crmMailingAB/Slider.js with 100% similarity]
ext/civi_mail/ang/crmMailingAB/Stats.js [moved from ang/crmMailingAB/Stats.js with 100% similarity]
ext/civi_mail/ang/crmMailingAB/WinnerDialogCtrl.html [moved from ang/crmMailingAB/WinnerDialogCtrl.html with 100% similarity]
ext/civi_mail/ang/crmMailingAB/WinnerDialogCtrl.js [moved from ang/crmMailingAB/WinnerDialogCtrl.js with 100% similarity]
ext/civi_mail/ang/crmMailingAB/services.js [moved from ang/crmMailingAB/services.js with 100% similarity]
ext/civi_mail/info.xml
karma.conf.js

index bd4037ceff6ce13e9c7b8c3fe42742cb7a61c7cc..7f1e548c483925e62d5e9a621193e091f88fe09a 100644 (file)
@@ -40,17 +40,6 @@ class CRM_Case_Info extends CRM_Core_Component_Info {
     ];
   }
 
-  /**
-   * @inheritDoc
-   */
-  public function getAngularModules() {
-    global $civicrm_root;
-
-    $result = [];
-    $result['crmCaseType'] = include "$civicrm_root/ang/crmCaseType.ang.php";
-    return $result;
-  }
-
   /**
    * @inheritDoc
    * @param bool $getAllUnconditionally
index 037b3cea0eb3e395acf3863edea59186309a5925..328f62d28a186311eb875a28c74f59d6e1a8aa3f 100644 (file)
@@ -110,17 +110,6 @@ abstract class CRM_Core_Component_Info {
     $this->info['url'] = $this->getKeyword();
   }
 
-  /**
-   * EXPERIMENTAL: Get a list of AngularJS modules
-   *
-   * @return array
-   *   list of modules; same format as CRM_Utils_Hook::angularModules(&$angularModules)
-   * @see CRM_Utils_Hook::angularModules
-   */
-  public function getAngularModules() {
-    return [];
-  }
-
   /**
    * Name of the module-extension coupled with this component
    * @return string
index 2eec29a4382ec93af4c858eccfb99df4a00b4963..b3f0c3371c082b3b1a7e6e48b0e6bbc5bdec014f 100644 (file)
@@ -129,23 +129,6 @@ class CRM_Mailing_Info extends CRM_Core_Component_Info {
     ];
   }
 
-  /**
-   * Get AngularJS modules and their dependencies.
-   *
-   * @return array
-   *   list of modules; same format as CRM_Utils_Hook::angularModules(&$angularModules)
-   * @see CRM_Utils_Hook::angularModules
-   */
-  public function getAngularModules() {
-    global $civicrm_root;
-
-    $result = [];
-    $result['crmMailing'] = include "$civicrm_root/ang/crmMailing.ang.php";
-    $result['crmMailingAB'] = include "$civicrm_root/ang/crmMailingAB.ang.php";
-
-    return $result;
-  }
-
   /**
    * @return bool
    */
index f2ea6b514f64bc5ea58ffdf3ba074c959b09896a..ac02fd054be86278200afffd1f13b2bf78437370 100644 (file)
@@ -81,42 +81,18 @@ class Manager {
     $angularModules = [];
     // Cache not set, fetch fresh list of modules and store in cache
     if (!$moduleNames) {
-      $config = \CRM_Core_Config::singleton();
-      global $civicrm_root;
-
-      // Note: It would be nice to just glob("$civicrm_root/ang/*.ang.php"), but at time
-      // of writing CiviMail and CiviCase have special conditionals.
-      $angularModules['angularFileUpload'] = include "$civicrm_root/ang/angularFileUpload.ang.php";
-      $angularModules['checklist-model'] = include "$civicrm_root/ang/checklist-model.ang.php";
-      $angularModules['crmApp'] = include "$civicrm_root/ang/crmApp.ang.php";
-      $angularModules['crmAttachment'] = include "$civicrm_root/ang/crmAttachment.ang.php";
-      $angularModules['crmAutosave'] = include "$civicrm_root/ang/crmAutosave.ang.php";
-      $angularModules['crmCxn'] = include "$civicrm_root/ang/crmCxn.ang.php";
-      $angularModules['crmDialog'] = include "$civicrm_root/ang/crmDialog.ang.php";
-      $angularModules['crmMonaco'] = include "$civicrm_root/ang/crmMonaco.ang.php";
-      $angularModules['crmResource'] = include "$civicrm_root/ang/crmResource.ang.php";
-      $angularModules['crmRouteBinder'] = include "$civicrm_root/ang/crmRouteBinder.ang.php";
-      $angularModules['crmUi'] = include "$civicrm_root/ang/crmUi.ang.php";
-      $angularModules['crmUtil'] = include "$civicrm_root/ang/crmUtil.ang.php";
-      $angularModules['dialogService'] = include "$civicrm_root/ang/dialogService.ang.php";
-      $angularModules['jsonFormatter'] = include "$civicrm_root/ang/jsonFormatter.ang.php";
-      $angularModules['ngRoute'] = include "$civicrm_root/ang/ngRoute.ang.php";
-      $angularModules['ngSanitize'] = include "$civicrm_root/ang/ngSanitize.ang.php";
-      $angularModules['ui.bootstrap'] = include "$civicrm_root/ang/ui.bootstrap.ang.php";
-      $angularModules['ui.sortable'] = include "$civicrm_root/ang/ui.sortable.ang.php";
-      $angularModules['unsavedChanges'] = include "$civicrm_root/ang/unsavedChanges.ang.php";
-      $angularModules['crmQueueMonitor'] = include "$civicrm_root/ang/crmQueueMonitor.ang.php";
-      $angularModules['crmStatusPage'] = include "$civicrm_root/ang/crmStatusPage.ang.php";
-      $angularModules['exportui'] = include "$civicrm_root/ang/exportui.ang.php";
-      $angularModules['api4Explorer'] = include "$civicrm_root/ang/api4Explorer.ang.php";
-      $angularModules['api4'] = include "$civicrm_root/ang/api4.ang.php";
-      $angularModules['crmDashboard'] = include "$civicrm_root/ang/crmDashboard.ang.php";
-      $angularModules['crmD3'] = include "$civicrm_root/ang/crmD3.ang.php";
-
-      foreach (\CRM_Core_Component::getEnabledComponents() as $component) {
-        $angularModules = array_merge($angularModules, $component->getAngularModules());
+      // Load all modules from CiviCRM core
+      $files = (array) glob(\Civi::paths()->getPath('[civicrm.root]/ang/*.ang.php'));
+      foreach ($files as $file) {
+        $name = basename($file, '.ang.php');
+        $module = include $file;
+        $module['ext'] = 'civicrm';
+        $angularModules[$name] = $module;
       }
+
+      // Load all modules from extensions
       \CRM_Utils_Hook::angularModules($angularModules);
+
       foreach ($angularModules as $module => $info) {
         // Merge in defaults
         $angularModules[$module] += ['basePages' => ['civicrm/a']];
similarity index 60%
rename from ang/crmCaseType.ang.php
rename to ext/civi_case/ang/crmCaseType.ang.php
index 62ba2a55c378a15d85091cff40fb3f73b3c52640..3cb411ac77a0d075caf04f24de91c28880d286c6 100644 (file)
@@ -1,9 +1,7 @@
 <?php
-// This file declares an Angular module which can be autoloaded
-// ODDITY: This only loads if CiviCase is active.
+// This file declares crmCaseType Angular module.
 
 return [
-  'ext' => 'civicrm',
   'js' => ['ang/crmCaseType.js'],
   'css' => ['ang/crmCaseType.css'],
   'partials' => ['ang/crmCaseType'],
index a3296ab988df32ca4b876ffc3c9f749aa9197ae7..165d49ffe48a691368fc32f0923ba23b30258b9b 100644 (file)
@@ -28,6 +28,7 @@
     <psr4 prefix="Civi\" path="Civi"/>
   </classloader>
   <mixins>
+    <mixin>ang-php@1.0.0</mixin>
     <mixin>scan-classes@1.0.0</mixin>
   </mixins>
   <civix>
similarity index 80%
rename from ang/crmMailing.ang.php
rename to ext/civi_mail/ang/crmMailing.ang.php
index e93dca1272074d07c8c9c317cd599b437190739f..b4f93c346fdf3d189cf0502c877ca38b33dc62e8 100644 (file)
@@ -1,9 +1,7 @@
 <?php
-// This file declares an Angular module which can be autoloaded
-// ODDITY: Only loads if you have CiviMail permissions.
+// This file declares crmMailing Angular module.
 
 return [
-  'ext' => 'civicrm',
   'js' => [
     'ang/crmMailing.js',
     'ang/crmMailing/*.js',
similarity index 67%
rename from ang/crmMailingAB.ang.php
rename to ext/civi_mail/ang/crmMailingAB.ang.php
index 38fd42d2c5e2191f8a2d51e0037b08e69f9ad63d..cc26cd4345a0e33ac8b6bf5e1d349853ede70143 100644 (file)
@@ -1,9 +1,7 @@
 <?php
-// This file declares an Angular module which can be autoloaded
-// ODDITY: Only loads if you have CiviMail permissions.
+// This file declares crmMailingAB Angular module.
 
 return [
-  'ext' => 'civicrm',
   'js' => [
     'ang/crmMailingAB.js',
     'ang/crmMailingAB/*.js',
index 7a167bfbd5981c4d7f84898de0ce43896204f7ba..a41bf719a652254115f9cd37ba5822251e24d7d4 100644 (file)
@@ -28,6 +28,7 @@
     <psr4 prefix="Civi\" path="Civi"/>
   </classloader>
   <mixins>
+    <mixin>ang-php@1.0.0</mixin>
     <mixin>scan-classes@1.0.0</mixin>
     <mixin>mgd-php@1.0.0</mixin>
   </mixins>
index d34a6077cba5d2688a34c9787ee469289a44ace1..59bdee47f33d9b32024cef890ff4f4ede5f40ba2 100644 (file)
@@ -48,15 +48,23 @@ module.exports = function(config) {
       'ang/**/*.js',
       'tests/karma/lib/*.js',
       'tests/karma/**/*.js',
-      'ang/**/*.html'
+      'ang/**/*.html',
+      'ext/civi_mail/ang/*.js',
+      'ext/civi_mail/ang/**/*.js',
+      'ext/civi_mail/ang/**/*.html',
+      'ext/civi_case/ang/*.js',
+      'ext/civi_case/ang/**/*.js',
+      'ext/civi_case/ang/**/*.html'
     ],
     preprocessors : {
-      'ang/**/*.html' : ['ng-html2js']
+      'ang/**/*.html': ['ng-html2js'],
+      'ext/*/ang/**/*.html': ['ng-html2js'],
     },
 
     ngHtml2JsPreprocessor: {
-      stripPrefix: 'ang/',
-      prependPrefix: '~/',
+      cacheIdFromPath: function(filepath) {
+        return filepath.replace(/.*ang\//, '~/');
+      },
       moduleName: 'crmResource'
     },
     frameworks: ['jasmine'],