Move core/framework code under `./core`
[civicrm-core.git] / ext / afform / core / templates / afform / AfformAngularModule.tpl
1 {* This takes an $afform and generates an AngularJS module.
2
3 @param string $afform.camel The full camel-case name of the AngularJS module being created
4 @param array $afform.meta The full metadata record of the form
5 @param string $afform.metaJson The full metadata record of the form
6 @param string $afform.layout The template content (HTML)
7 *}
8 {literal}
9 (function(angular, $, _) {
10 angular.module('{/literal}{$afform.camel}{literal}', CRM.angRequires('{/literal}{$afform.camel}{literal}'));
11 angular.module('{/literal}{$afform.camel}{literal}').directive('{/literal}{$afform.camel}{literal}', function(afformCoreDirective) {
12 return afformCoreDirective({/literal}{$afform.camel|json},{$afform.metaJson}{literal}, {
13 template: {/literal}{$afform.layout|json}{literal}
14 });
15 });
16 })(angular, CRM.$, CRM._);
17 {/literal}