Rename afformCore to afCore
[civicrm-core.git] / ext / afform / core / templates / afform / AfformAngularModule.tpl
CommitLineData
01e92c8a 1{* This takes an $afform and generates an AngularJS module.
bb56ac78 2
01e92c8a
TO
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)
bb56ac78
TO
7 *}
8{literal}
9(function(angular, $, _) {
10 angular.module('{/literal}{$afform.camel}{literal}', CRM.angRequires('{/literal}{$afform.camel}{literal}'));
c1b9955f
TO
11 angular.module('{/literal}{$afform.camel}{literal}').directive('{/literal}{$afform.camel}{literal}', function(afCoreDirective) {
12 return afCoreDirective({/literal}{$afform.camel|json},{$afform.metaJson}{literal}, {
ddae34c0
TO
13 template: {/literal}{$afform.layout|json}{literal}
14 });
bb56ac78
TO
15 });
16})(angular, CRM.$, CRM._);
17{/literal}