tiborm commented on a change in pull request #1514: METRON-2190: [UI] Alerts 
UI: Indicating loading and preventing parallel requests
URL: https://github.com/apache/metron/pull/1514#discussion_r326997272
 
 

 ##########
 File path: 
metron-interface/metron-alerts/src/app/alerts/alerts-list/alerts-list.component.ts
 ##########
 @@ -75,7 +73,18 @@ export class AlertsListComponent implements OnInit, 
OnDestroy {
   @ViewChild('table') table: ElementRef;
   @ViewChild('dataViewComponent') dataViewComponent: TableViewComponent;
   @ViewChild(AlertSearchDirective) alertSearchDirective: AlertSearchDirective;
-  @ViewChild('manualQuery') manualQuery: ElementRef;
+
+  private manualQueryFieldChangeSubs: Subscription;
+  private manualQueryInputEl: ElementRef;
+  @ViewChild('manualQuery') set manualQuery(el: ElementRef) {
+    if (el && !this.manualQueryInputEl) {
+      this.manualQueryInputEl = el;
+      this.manualQueryFieldChangeSubs = 
this.addManualQueryFieldChangeStream(el.nativeElement);
+    }
+  };
+  get manualQuery(): ElementRef {
+    return this.manualQueryInputEl;
+  }
 
 Review comment:
   This structure is used to use to deal with a viewChild in an ngIf.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to