|
@@ -1,5 +1,5 @@
|
|
import { Component, Attribute, OnInit, Input } from '@angular/core';
|
|
import { Component, Attribute, OnInit, Input } from '@angular/core';
|
|
-import { ControlContainer, FormGroup, FormControl } from '@angular/forms';
|
|
|
|
|
|
+import { /* ControlContainer, */ FormGroup, FormControl } from '@angular/forms';
|
|
|
|
|
|
@Component({
|
|
@Component({
|
|
selector: 'app-checkbutton-group',
|
|
selector: 'app-checkbutton-group',
|
|
@@ -9,10 +9,10 @@ import { ControlContainer, FormGroup, FormControl } from '@angular/forms';
|
|
export class CheckbuttonGroupComponent implements OnInit {
|
|
export class CheckbuttonGroupComponent implements OnInit {
|
|
|
|
|
|
@Input()
|
|
@Input()
|
|
- group: FormGroup;
|
|
|
|
|
|
+ control: FormGroup;
|
|
|
|
|
|
@Input()
|
|
@Input()
|
|
- meta = {};
|
|
|
|
|
|
+ meta: StringMap;
|
|
|
|
|
|
controlNames: Array<string>;
|
|
controlNames: Array<string>;
|
|
isDisabled: Array<boolean>;
|
|
isDisabled: Array<boolean>;
|
|
@@ -21,15 +21,16 @@ export class CheckbuttonGroupComponent implements OnInit {
|
|
firstControl: FormControl;
|
|
firstControl: FormControl;
|
|
|
|
|
|
constructor(
|
|
constructor(
|
|
- private cc: ControlContainer,
|
|
|
|
|
|
+ /* private cc: ControlContainer */,
|
|
@Attribute('firstEnablesRest') private firstEnablesRest
|
|
@Attribute('firstEnablesRest') private firstEnablesRest
|
|
) {
|
|
) {
|
|
this.firstEnablesRest = firstEnablesRest === ''; // True if 'firstEnablesRest' exists as component attribute
|
|
this.firstEnablesRest = firstEnablesRest === ''; // True if 'firstEnablesRest' exists as component attribute
|
|
}
|
|
}
|
|
|
|
|
|
ngOnInit() {
|
|
ngOnInit() {
|
|
- this.controlNames = Object.keys(this.cc.control.value);
|
|
|
|
- console.log(this.controlNames)
|
|
|
|
|
|
+ this.controlNames = Object.keys(this.cc.control);
|
|
|
|
+ console.log('HERE I AM', this.control, this.meta.name);
|
|
|
|
+ console.log(this.controlNames);
|
|
/*
|
|
/*
|
|
const labelShortfall = this.controlNames.length - this.labels.length;
|
|
const labelShortfall = this.controlNames.length - this.labels.length;
|
|
if (labelShortfall > 0) {
|
|
if (labelShortfall > 0) {
|