Revert "[apiService] created a service for getting the API URL"
[u/erikhf/frm.git] / src / components / filter / filter.ts
CommitLineData
2a81f0e8
EHF
1import {Component, View, CORE_DIRECTIVES} from 'angular2/angular2';
2import {Headers, Http} from 'angular2/http';
29aebc75
EHF
3
4@Component({
5 selector: 'mou-filter',
6 directives: [CORE_DIRECTIVES],
76533018 7 templateUrl: './components/filter/filter.html'
29aebc75
EHF
8})
9
10export class Filter {
2a81f0e8 11 result: Object;
29aebc75 12
2a81f0e8
EHF
13 // Example HTTP request
14
15 /*
16 constructor(http: Http) {
17 var authHeader = new Headers();
18 authHeader.append('Authorization', 'Basic YWRtaW46ZGlzdHJpY3Q=');
19 this.result = {organisationUnits:[]};
20 http.get(dhisAPI+'/api/organisationUnits?paging=false', {headers: authHeader})
21 //http.get('orgunit.json')
22 .map(res => res.json()).subscribe(
23 res => this.result = res,
24 error => this.logError(error)
25 );
26 }
29aebc75
EHF
27
28
2a81f0e8
EHF
29 logError(error){
30 console.error(error);
31 }
29aebc75 32
2a81f0e8
EHF
33 */
34}