@pega/dx-component-builder-sdk
Version:
Utility for building custom UI components
35 lines (28 loc) • 981 B
text/typescript
import { Component, OnInit, Input, forwardRef, SimpleChanges, OnChanges } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormGroup } from '@angular/forms';
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
({
selector: 'app-narrow-wide-form',
templateUrl: './narrow-wide-form.component.html',
styleUrls: ['./narrow-wide-form.component.scss'],
standalone: true,
imports: [CommonModule, forwardRef(() => ComponentMapperComponent)]
})
export class NarrowWideFormComponent implements OnInit, OnChanges {
() pConn$: typeof PConnect;
() formGroup$: FormGroup;
arChildren$: any[];
ngOnInit() {
this.updateSelf();
}
ngOnChanges(changes: SimpleChanges): void {
const { pConn$ } = changes;
if (pConn$.previousValue && pConn$.previousValue !== pConn$.currentValue) {
this.updateSelf();
}
}
updateSelf() {
this.arChildren$ = this.pConn$.getChildren();
}
}