begin re-implementation of auto-populate feature

This commit is contained in:
Chris Meyers
2017-01-06 14:36:00 -05:00
committed by jaredevantabor
parent 0d8d9b3643
commit 67f282f64d
2 changed files with 46 additions and 1 deletions

View File

@@ -376,6 +376,11 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
},
applyDefaults: function (form, scope) {
// Note: This is a hack. Ideally, mode should be set in each <resource>-<mode>.controller.js
// The mode is needed by the awlookup directive to auto-populate form fields when there is a
// single related resource.
scope.mode = this.mode;
for (var fld in form.fields) {
if (form.fields[fld]['default'] || form.fields[fld]['default'] === 0) {
if (form.fields[fld].type === 'select' && scope[fld + '_options']) {