1 |
58904
|
stefania.m
|
import { Component } from '@angular/core';
|
2 |
58912
|
stefania.m
|
import { Router } from '@angular/router';
|
3 |
|
|
import { countries } from '../../domain/countries';
|
4 |
60124
|
stefania.m
|
import { environment } from '../../../environments/environment';
|
5 |
57592
|
stefania.m
|
|
6 |
|
|
@Component({
|
7 |
|
|
selector: 'app-top-menu',
|
8 |
|
|
templateUrl: './top-menu.component.html',
|
9 |
|
|
})
|
10 |
|
|
|
11 |
|
|
export class TopmenuComponent {
|
12 |
58904
|
stefania.m
|
|
13 |
58912
|
stefania.m
|
countriesCollection = countries;
|
14 |
|
|
keyword = 'name';
|
15 |
|
|
|
16 |
60124
|
stefania.m
|
environmentName = environment.environmentName;
|
17 |
|
|
|
18 |
58904
|
stefania.m
|
constructor(private router: Router) {
|
19 |
|
|
}
|
20 |
|
|
|
21 |
|
|
isHomeRoute() {
|
22 |
|
|
return (this.router.url === '/home');
|
23 |
|
|
}
|
24 |
58912
|
stefania.m
|
|
25 |
|
|
selectCountryFromAutocompleteEvent(item) {
|
26 |
|
|
// do something with selected item
|
27 |
|
|
// console.log('country selected: ', item);
|
28 |
|
|
this.router.navigate([`/countryDashboard/${item.id}`]);
|
29 |
|
|
}
|
30 |
|
|
|
31 |
|
|
onChangeSearch(search: string) {
|
32 |
|
|
// fetch remote data from here
|
33 |
|
|
// And reassign the 'data' which is binded to 'data' property.
|
34 |
|
|
}
|
35 |
|
|
|
36 |
|
|
onFocused(e) {
|
37 |
|
|
// do something
|
38 |
|
|
}
|
39 |
57592
|
stefania.m
|
}
|