From efe9f74e94f5f473337b977bb6f1e6523666398a Mon Sep 17 00:00:00 2001 From: Yves Peter Date: Tue, 19 Dec 2017 21:52:53 +0100 Subject: [PATCH] angular deploy: reset filter selection on change --- .../io/src/app/deployment/deployments.component.html | 2 +- AMW_angular/io/src/app/deployment/deployments.component.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/AMW_angular/io/src/app/deployment/deployments.component.html b/AMW_angular/io/src/app/deployment/deployments.component.html index 28af69fed..3b6ae65ab 100644 --- a/AMW_angular/io/src/app/deployment/deployments.component.html +++ b/AMW_angular/io/src/app/deployment/deployments.component.html @@ -19,7 +19,7 @@

{{appState.get('pageTitle')}}

-
diff --git a/AMW_angular/io/src/app/deployment/deployments.component.ts b/AMW_angular/io/src/app/deployment/deployments.component.ts index 5b6663921..044a1f6a7 100644 --- a/AMW_angular/io/src/app/deployment/deployments.component.ts +++ b/AMW_angular/io/src/app/deployment/deployments.component.ts @@ -1,5 +1,6 @@ -import { Component, OnInit, NgZone } from '@angular/core'; +import { Component, OnInit, NgZone, ViewChild } from '@angular/core'; import { Location } from '@angular/common'; +import { NgModel } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; import { AppState } from '../app.service'; import { ComparatorFilterOption } from './comparator-filter-option'; @@ -21,6 +22,7 @@ declare var $: any; }) export class DeploymentsComponent implements OnInit { + @ViewChild('selectModel') private selectModel: NgModel; defaultComparator: string = 'eq'; @@ -121,10 +123,11 @@ export class DeploymentsComponent implements OnInit { newFilter.type = this.selectedFilterType.type; newFilter.compOptions = this.comparatorOptionsForType(this.selectedFilterType.type); this.setValueOptionsForFilter(newFilter); - this.filters.unshift(newFilter); + this.filters.push(newFilter); this.enableDatepicker(newFilter.type); this.offset = 0; this.selectedFilterType = null; + this.selectModel.reset(null); } }