Revision 60820
Added by Konstantinos Triantafyllou almost 3 years ago
contact-us.component.ts | ||
---|---|---|
10 | 10 |
styleUrls: ['contact-us.component.css'] |
11 | 11 |
}) |
12 | 12 |
|
13 |
export class ContactUsComponent implements OnInit {
|
|
13 |
export class ContactUsComponent { |
|
14 | 14 |
@Input() |
15 | 15 |
public contactForm: FormGroup; |
16 | 16 |
@Input() formTitle: string; |
... | ... | |
23 | 23 |
public right: boolean = true; |
24 | 24 |
@Input() |
25 | 25 |
public buttonClass: string; |
26 |
public autoCompleteTypes: Observable<string[]>; |
|
27 | 26 |
|
28 |
constructor() { |
|
29 |
} |
|
30 |
|
|
31 |
ngOnInit() { |
|
32 |
if(this.contactForm.get('organizationType')) { |
|
33 |
this.autoCompleteTypes = this.contactForm.get('organizationType').valueChanges |
|
34 |
.pipe( |
|
35 |
startWith(''), |
|
36 |
map(value => this._filter(value)) |
|
37 |
); |
|
38 |
} |
|
39 |
} |
|
40 |
|
|
41 |
private _filter(value: string): string[] { |
|
42 |
const filterValue = value.toLowerCase(); |
|
43 |
return this.organizationTypes.filter(option => option.toLowerCase().includes(filterValue)); |
|
44 |
} |
|
45 |
|
|
46 | 27 |
public send() { |
47 | 28 |
this.sendEmitter.emit({ |
48 | 29 |
valid: this.contactForm.valid |
Also available in: Unified diff
[Library | Trunk]: contact us change organization type to select