Client datatables to be shown on the Client creation page based on legal form
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
@@ -16,6 +16,8 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
})
|
||||
export class ClientGeneralStepComponent implements OnInit {
|
||||
|
||||
@Output() legalFormChangeEvent = new EventEmitter<{ legalForm: number }>();
|
||||
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
@@ -104,7 +106,8 @@ export class ClientGeneralStepComponent implements OnInit {
|
||||
* Adds controls conditionally.
|
||||
*/
|
||||
buildDependencies() {
|
||||
this.createClientForm.get('legalFormId').valueChanges.subscribe((legalFormId: any) => {
|
||||
this.createClientForm.get('legalFormId').valueChanges.subscribe((legalFormId: number) => {
|
||||
this.legalFormChangeEvent.emit({ legalForm: legalFormId });
|
||||
if (legalFormId === 1) {
|
||||
this.createClientForm.removeControl('fullname');
|
||||
this.createClientForm.removeControl('clientNonPersonDetails');
|
||||
|
||||
Reference in New Issue
Block a user