Adds id's to all form groups and new forms

This commit is contained in:
mabashian
2018-08-02 12:28:02 -04:00
parent 45c067b599
commit 8523b56707
5 changed files with 21 additions and 16 deletions
@@ -16,6 +16,7 @@ function AtInputGroupController ($scope, $compile) {
let state;
let source;
let element;
let formId;
vm.init = (_scope_, _form_, _element_) => {
form = _form_;
@@ -23,6 +24,7 @@ function AtInputGroupController ($scope, $compile) {
element = _element_;
state = scope.state || {};
source = state._source;
formId = scope.formId;
$scope.$watch('state._source._value', vm.update);
};
@@ -145,7 +147,7 @@ function AtInputGroupController ($scope, $compile) {
const tabindex = Number(scope.tab) + index;
const col = input._expand ? 12 : scope.col;
const component = angular.element(`<${input._component} col="${col}" tab="${tabindex}"
state="${state._reference}._group[${index}]">
state="${state._reference}._group[${index}]" id="${formId}_${input.id}_group">
</${input._component}>`);
$compile(component)(scope.$parent);
@@ -183,7 +185,8 @@ function atInputGroup () {
scope: {
state: '=',
col: '@',
tab: '@'
tab: '@',
formId: '@'
}
};
}