From 69c2d1a2601dff14a744d21e83ce46f2648c1a51 Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 10 Jan 2020 14:09:34 +1300 Subject: [PATCH] Reinstate parsing of data from the form This means that data can be set in an embedded form e.g In this case the options.name_as comes from the directive that instantiates this afform --- ext/afform/core/ang/af/Form.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/afform/core/ang/af/Form.js b/ext/afform/core/ang/af/Form.js index 06f3b9d183..e97a40e9df 100644 --- a/ext/afform/core/ang/af/Form.js +++ b/ext/afform/core/ang/af/Form.js @@ -20,7 +20,10 @@ this.registerEntity = function registerEntity(entity) { schema[entity.modelName] = entity; - data[entity.modelName] = []; + // Permitting entity.data allows the afform to specify variables like + // that has been passing into the afform with the directive that initiates it. + // This is an advanced usage & afJoin is more normal. + data[entity.modelName] = entity.data || {}; }; this.getEntity = function getEntity(name) { return schema[name]; -- 2.25.1