aboutsummaryrefslogtreecommitdiffstats
path: root/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource
diff options
context:
space:
mode:
Diffstat (limited to 'cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource')
-rw-r--r--cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.html15
-rw-r--r--cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.ts18
2 files changed, 24 insertions, 9 deletions
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.html b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.html
index 68ea10bb0..ab696286b 100644
--- a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.html
+++ b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.html
@@ -18,7 +18,14 @@
* ============LICENSE_END=========================================================
*/-->
-
-<p>
- search-resource works!
-</p>
+<form class="example-form" [formGroup]="myControl">
+ <mat-form-field class="example-full-width">
+ <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">
+ {{option}}
+ </mat-option>
+ </mat-autocomplete>
+ </mat-form-field>
+</form>
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.ts b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.ts
index 8759adf82..16129b74a 100644
--- a/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.ts
+++ b/cds-ui/client/src/app/feature-modules/resource-definition/resource-creation/existing-model/search-resource/search-resource.component.ts
@@ -19,17 +19,25 @@
*/
import { Component, OnInit } from '@angular/core';
-
+import {FormBuilder, FormGroup, Validators} from '@angular/forms';
@Component({
selector: 'app-search-resource',
templateUrl: './search-resource.component.html',
styleUrls: ['./search-resource.component.scss']
})
-export class SearchResourceComponent implements OnInit {
+export class SearchResourceComponent implements OnInit {
- constructor() { }
+ myControl: FormGroup;
- ngOnInit() {
+ constructor(private _formBuilder: FormBuilder) { }
+
+ options: string[] = ['One','One1', 'Two', 'Three'];
+
+ ngOnInit() {
+ this.myControl = this._formBuilder.group({
+ search_input: ['', Validators.required]
+ });
}
-
+
}
+