Merge "search resources changes"
authorDan Timoney <dtimoney@att.com>
Sun, 31 Mar 2019 12:44:58 +0000 (12:44 +0000)
committerGerrit Code Review <gerrit@onap.org>
Sun, 31 Mar 2019 12:44:58 +0000 (12:44 +0000)
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.html
cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.ts

index ab69628..236196b 100644 (file)
@@ -23,7 +23,7 @@
     <input type="text" [(ngModel)]="searchText" placeholder="Search Resources" matInput [matAutocomplete]="auto" formControlName="search_input">
     <button matSuffix mat-icon-button><mat-icon>search</mat-icon></button>
     <mat-autocomplete #auto="matAutocomplete">
-      <mat-option *ngFor="let option of options | search : searchText" [value]="option">
+      <mat-option (click)="selected(option)" *ngFor="let option of options | search : searchText" [value]="option">
         {{option}}
       </mat-option>
     </mat-autocomplete>
index 16129b7..7f2745e 100644 (file)
@@ -18,7 +18,7 @@
 * ============LICENSE_END=========================================================
 */
 
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, ViewChild, EventEmitter, Output  } from '@angular/core';
 import {FormBuilder, FormGroup, Validators} from '@angular/forms';
 @Component({
   selector: 'app-search-resource',
@@ -27,17 +27,18 @@ import {FormBuilder, FormGroup, Validators} from '@angular/forms';
 })
 export class SearchResourceComponent implements OnInit  {
 
-   myControl: FormGroup;
-
+  myControl: FormGroup;
+  @Output() resourcesData = new EventEmitter();  
+  options: string[] = ['One','One1', 'Two', 'Three'];
   constructor(private _formBuilder: FormBuilder)  { }
   
-  options: string[] = ['One','One1', 'Two', 'Three'];
-    
-    ngOnInit() {
+ ngOnInit() {
     this.myControl = this._formBuilder.group({
       search_input: ['', Validators.required]
     });
   }
-    
+ selected(value){
+   this.resourcesData.emit(value);
+   } 
 }