Commit 09870171 authored by colemanw's avatar colemanw
Browse files

Merge afField module into af module

parent 27b91225
......@@ -10,7 +10,7 @@ return [
'ang/af/*/*.js',
],
// 'css' => ['ang/af.css'],
// 'partials' => ['ang/af'],
'partials' => ['ang/af'],
'requires' => ['crmUtil'],
'settings' => [],
'basePages' => [],
......@@ -18,5 +18,6 @@ return [
'af-entity' => 'E',
'af-fieldset' => 'A',
'af-form' => 'E',
'af-field' => 'E',
],
];
(function(angular, $, _) {
// Example usage: <div af-fieldset="myModel"><af-field name="do_not_email" /></div>
angular.module('afField').directive('afField', function() {
angular.module('af').directive('afField', function() {
return {
restrict: 'E',
require: ['^afFieldset', '^afForm'],
templateUrl: '~/afField/afField.html',
templateUrl: '~/af/afField.html',
scope: {
fieldName: '@name', // TEST ME
fieldName: '@name',
defn: '='
},
link: function($scope, $el, $attr, ctrls) {
......
......@@ -2,5 +2,5 @@
{{ defn.title }}
</label>
<p class="crm-af-field-help-pre" ng-if="defn.help_pre">{{ defn.help_pre }}</p>
<div class="crm-af-field" ng-include="'~/afField/widgets/' + defn.input_type + '.html'"></div>
<div class="crm-af-field" ng-include="'~/af/fields/' + defn.input_type + '.html'"></div>
<p class="crm-af-field-help-post" ng-if="defn.help_post">{{ defn.help_post }}</p>
<?php
// This file declares an Angular module which can be autoloaded
// in CiviCRM. See also:
// http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_angularModules
return [
'js' => [
'ang/afField.js',
'ang/afField/*.js',
'ang/afField/*/*.js',
],
'css' => ['ang/afField.css'],
'partials' => ['ang/afField'],
'requires' => [
'crmUi',
'crmUtil',
],
'settings' => [],
'basePages' => [],
'exports' => [
'af-field' => 'E',
],
];
/* Add any CSS rules for Angular module "afField" */
(function(angular, $, _) {
// Declare a list of dependencies.
angular.module('afField', CRM.angRequires('afField'));
})(angular, CRM.$, CRM._);
{
"server_route": "civicrm/afex",
"requires":["mockFoo", "mockBareFile", "af", "afBlock", "afField"]
"requires":["mockFoo", "mockBareFile", "af", "afBlock"]
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment