Make templating more responsive
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good

This commit is contained in:
Willem Dantuma
2020-04-17 08:01:39 +02:00
parent be4cbd36d1
commit da0534e928
7 changed files with 44 additions and 56 deletions

View File

@@ -49,9 +49,9 @@ export class FeatureListContainerComponent {
viewContainerRef.clear();
this.componentRef = viewContainerRef.createComponent(componentFactory);
(<AbstractFeatureListComponent>this.componentRef.instance).features = this.features;
(<AbstractFeatureListComponent>this.componentRef.instance).queryState = this.queryState;
(<AbstractFeatureListComponent>this.componentRef.instance).selectedFeature = this.selectedFeature;
(<AbstractFeatureListComponent>this.componentRef.instance).features = null;
(<AbstractFeatureListComponent>this.componentRef.instance).queryState = queryState;
(<AbstractFeatureListComponent>this.componentRef.instance).selectedFeature = null;
}
ngOnInit() {
@@ -61,10 +61,11 @@ export class FeatureListContainerComponent {
}
ngOnChanges(changes: SimpleChanges) {
if ((changes["queryState"] && changes["queryState"].currentValue)) {
this.loadComponent(changes["queryState"].currentValue);
}
if ((changes["features"] && changes["features"].currentValue)) {
if (this.queryState) {
this.loadComponent(this.queryState);
}
(<AbstractFeatureListComponent>this.componentRef.instance).features = changes["features"].currentValue;
}
if(changes["selectedFeature"]) {
(<AbstractFeatureListComponent>this.componentRef.instance).selectedFeature = changes["selectedFeature"].currentValue;