Skip to content
This repository was archived by the owner on Apr 30, 2018. It is now read-only.

Commit 2ae1e51

Browse files
committed
forgot to build the release again, should automate that...
1 parent 9f426e8 commit 2ae1e51

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

dist/formly.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,22 @@ angular.module('formly.render').directive('formlyForm', function formlyForm() {
9898
$scope.populateResult = function () {
9999
var formChildren = $element.children();
100100
var fieldScope;
101-
angular.forEach(formChildren, function (field, key) {
101+
angular.forEach(formChildren, function (fieldElement, key) {
102102
// grab fields isolate scope
103-
fieldScope = angular.element(field).scope();
104-
$scope.result[fieldScope.$index] = fieldScope.value;
103+
fieldScope = angular.element(fieldElement).scope();
104+
// check if its a form field, otherwise ignore, ie its the button
105+
if (fieldScope.field) {
106+
// if a key is set, then save the data with that key in the result object
107+
// otherwise use the field's index from the fields array
108+
var dataKey;
109+
if ('key' in fieldScope.field) {
110+
dataKey = fieldScope.field.key;
111+
} else {
112+
dataKey = fieldScope.$index;
113+
}
114+
// set value in result
115+
$scope.result[dataKey] = fieldScope.value;
116+
}
105117
});
106118
};
107119
}

dist/formly.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/formly.min.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)