area.component.ts 928 Bytes
Newer Older
1
import { Component, OnInit } from '@angular/core';
mdsecurity's avatar
mdsecurity committed
2
import { DataProviderService } from '../../data-provider.service';
3
import { Place } from '../../place';
mdsecurity's avatar
mdsecurity committed
4
import {SearchService} from '../../search.service';
mdsecurity's avatar
mdsecurity committed
5
@Component({
mdsecurity's avatar
mdsecurity committed
6
7
8
	selector: 'app-area',
	templateUrl: './area.component.html',
	styleUrls: ['./area.component.scss']
mdsecurity's avatar
mdsecurity committed
9
10
})
export class AreaComponent implements OnInit {
11
	private places: Place[] = [];
12
13
	private placee: Place = new Place();
	private show = false;
mdsecurity's avatar
mdsecurity committed
14
15
	private searchTerm:string = "";
	constructor(private dataProvider: DataProviderService, private search:SearchService) { }
mdsecurity's avatar
mdsecurity committed
16

mdsecurity's avatar
mdsecurity committed
17
18
	ngOnInit() {
		this.dataProvider.getFacilities().subscribe(
19
20
21
22
23
			(places) => {
				this.places = places;
				this.placee = places[12];
				this.show = true;
			},
mdsecurity's avatar
mdsecurity committed
24
25
			(error) => { console.log(error); }
		)
mdsecurity's avatar
mdsecurity committed
26
27
28
29
30
31
32
33
		this.search.$seachArg.subscribe(
			(term) =>{
				this.searchTerm = term;	
			},
			(error)=>{
				console.log(error);
			}
		)
mdsecurity's avatar
mdsecurity committed
34
	}
mdsecurity's avatar
mdsecurity committed
35
36
37


}