Afform - Fix form submit button
authorColeman Watts <coleman@civicrm.org>
Fri, 29 Jan 2021 18:32:13 +0000 (13:32 -0500)
committerColeman Watts <coleman@civicrm.org>
Fri, 29 Jan 2021 18:32:13 +0000 (13:32 -0500)
ext/afform/core/ang/af/afForm.component.js

index 8d627ed6cbb7d2d7f592bf581a8bdd0efb47e2f2..d7b0d8fc4e0cb2c8ef736f8e1720f1b37af3c86b 100644 (file)
@@ -9,10 +9,10 @@
         data = {},
         ctrl = this;
 
-      // This component has no template. It makes its controller available within it by adding it to the parent scope.
-      $scope.$parent[this.ctrl] = this;
-
       this.$onInit = function() {
+        // This component has no template. It makes its controller available within it by adding it to the parent scope.
+        $scope.$parent[this.ctrl] = this;
+
         $timeout(ctrl.loadData);
       };