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

mdsecurity's avatar
mdsecurity committed
14
15
	ngOnInit() {
		this.dataProvider.getFacilities().subscribe(
16
17
18
			(places) => { this.places = places;
			this.placee = places[2];
		console.log(places[2]);},
mdsecurity's avatar
mdsecurity committed
19
20
21
			(error) => { console.log(error); }
		)
	}
mdsecurity's avatar
mdsecurity committed
22
23
24


}