afformCore - Expose crmApi4 and crmStatus in standard scopes
authorTim Otten <totten@civicrm.org>
Sun, 5 May 2019 04:30:40 +0000 (21:30 -0700)
committerCiviCRM <info@civicrm.org>
Wed, 16 Sep 2020 02:13:18 +0000 (19:13 -0700)
ext/afform/core/ang/afformCore.js

index 7548db1f5c8c68474db07810ef9f281efc4becf9..afad2607e219b7d17358f006473f63fadd9e846f 100644 (file)
@@ -1,11 +1,11 @@
 (function(angular, $, _) {
   // Declare a list of dependencies.
   angular.module('afformCore', [
-    'crmUi', 'crmUtil', 'ngRoute'
+    'crmUi', 'crmUtil', 'ngRoute', 'api4'
   ]);
 
   // Use `afformCoreDirective(string name)` to generate an AngularJS directive.
-  angular.module('afformCore').service('afformCoreDirective', function($routeParams){
+  angular.module('afformCore').service('afformCoreDirective', function($routeParams, crmApi4, crmStatus){
     return function(camelName, meta, d){
       d.restrict = 'AE';
       d.scope = {};
@@ -14,6 +14,8 @@
         $scope.ts = CRM.ts(camelName);
         $scope.routeParams = $routeParams;
         $scope.meta = meta;
+        $scope.crmApi4 = crmApi4;
+        $scope.crmStatus = crmStatus;
       };
       return d;
     };