Skip to content
Snippets Groups Projects
Commit 268a01d3 authored by Clayton, Brandon Scott's avatar Clayton, Brandon Scott
Browse files

handle create map

parent 87013caf
No related branches found
No related tags found
1 merge request!572AWS Updates
......@@ -116,7 +116,7 @@ export class FormComponent implements OnInit, OnDestroy {
/** Control form state */
form = this.service.formGroup;
private overrideSubscription = new Subscription();
private subscriptions: Subscription[] = [];
constructor(
public service: AppService,
......@@ -132,9 +132,9 @@ export class FormComponent implements OnInit, OnDestroy {
}
ngOnInit(): void {
const {nshmpConfig} = this.form.controls;
const {mapConfig, nshmpConfig} = this.form.controls;
this.overrideSubscription =
const overrideSubscription =
this.form.controls.overrideNshmpLib.valueChanges.subscribe(
overrideNshmpLib => {
if (overrideNshmpLib) {
......@@ -150,10 +150,26 @@ export class FormComponent implements OnInit, OnDestroy {
}
},
);
this.subscriptions.push(overrideSubscription);
const mapSubscription = mapConfig.controls.createMap.valueChanges.subscribe(
createMap => {
if (createMap) {
mapConfig.controls.region.enable();
mapConfig.controls.title.enable();
} else {
mapConfig.controls.region.disable();
mapConfig.controls.title.disable();
}
},
);
this.subscriptions.push(mapSubscription);
}
ngOnDestroy(): void {
this.overrideSubscription.unsubscribe();
this.subscriptions.forEach(subscription => subscription.unsubscribe());
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment