Skip to content

Commit 687c8d8

Browse files
committed
chore(build)
1 parent fa1caa8 commit 687c8d8

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

dist/forms-angular.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ declare module fng.directives {
171171
function fngLink(routingService: any, SubmissionsService: any): angular.IDirective;
172172
}
173173
declare module fng.directives {
174-
function formInput($compile: any, $rootScope: any, $filter: any, $data: any, cssFrameworkService: any, formGenerator: any, formMarkupHelper: any): angular.IDirective;
174+
function formInput($compile: any, $rootScope: any, $filter: any, $data: any, $timeout: any, cssFrameworkService: any, formGenerator: any, formMarkupHelper: any): angular.IDirective;
175175
}
176176
declare module fng.directives {
177177
function formButtons(cssFrameworkService: any): angular.IDirective;

dist/forms-angular.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ var fng;
459459
tabsSetupState[tabsSetupState["Forced"] = 2] = "Forced";
460460
})(tabsSetupState || (tabsSetupState = {}));
461461
/*@ngInject*/
462-
function formInput($compile, $rootScope, $filter, $data, cssFrameworkService, formGenerator, formMarkupHelper) {
462+
function formInput($compile, $rootScope, $filter, $data, $timeout, cssFrameworkService, formGenerator, formMarkupHelper) {
463463
return {
464464
restrict: 'EA',
465465
link: function (scope, element, attrs) {
@@ -1084,8 +1084,22 @@ var fng;
10841084
}
10851085
}
10861086
if (!matching) {
1087-
// There is no matching array element - we need to create one
1088-
arrayOffset = theRecord[info.name].push(thisSubkeyList) - 1;
1087+
// There is no matching array element
1088+
switch (arrayToProcess[thisOffset].onNotFound) {
1089+
case 'error':
1090+
var errorMessage = 'Cannot find matching ' + (arrayToProcess[thisOffset].title || arrayToProcess[thisOffset].path);
1091+
//Have to do this async as setPristine clears it
1092+
$timeout(function () {
1093+
scope.showError(errorMessage, 'Unable to set up form correctly');
1094+
});
1095+
arrayOffset = -1;
1096+
//throw new Error(scope.errorMessage);
1097+
break;
1098+
case 'create':
1099+
default:
1100+
arrayOffset = theRecord[info.name].push(thisSubkeyList) - 1;
1101+
break;
1102+
}
10891103
}
10901104
}
10911105
else {
@@ -1108,7 +1122,7 @@ var fng;
11081122
}
11091123
};
11101124
}
1111-
formInput.$inject = ["$compile", "$rootScope", "$filter", "$data", "cssFrameworkService", "formGenerator", "formMarkupHelper"];
1125+
formInput.$inject = ["$compile", "$rootScope", "$filter", "$data", "$timeout", "cssFrameworkService", "formGenerator", "formMarkupHelper"];
11121126
directives.formInput = formInput;
11131127
})(directives = fng.directives || (fng.directives = {}));
11141128
})(fng || (fng = {}));

dist/forms-angular.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/forms-angular.min.js.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)