]> git.uio.no Git - u/erikhf/frm.git/blob - src/components/filter/filter.ts
Merge branch 'master' into search
[u/erikhf/frm.git] / src / components / filter / filter.ts
1 import {Component, View, CORE_DIRECTIVES} from 'angular2/angular2';
2 import {Headers, Http} from 'angular2/http';
3 import {DhisapiService} from "../dhisapi/dhisapiService";
4
5 @Component({
6     selector: 'mou-filter',
7     directives: [CORE_DIRECTIVES],
8     templateUrl: './components/filter/filter.html',
9     providers: [DhisapiService]
10 })
11
12 export class Filter {
13     result: Object;
14
15     dhis: DhisapiService;
16     // Example HTTP request
17
18     /*
19     constructor(http: Http) {
20         var authHeader = new Headers();
21         authHeader.append('Authorization', 'Basic YWRtaW46ZGlzdHJpY3Q=');
22         this.result = {organisationUnits:[]};
23         http.get(dhisAPI+'/api/organisationUnits?paging=false', {headers: authHeader})
24         //http.get('orgunit.json')
25             .map(res => res.json()).subscribe(
26             res => this.result = res,
27             error => this.logError(error)
28         );
29     }
30
31
32     logError(error){
33         console.error(error);
34     }
35
36     */
37
38     constructor(dhis: DhisapiService){
39         this.dhis = dhis;
40     }
41
42     onInit(){
43         this.dhis.getApiURL(function(uri){
44             console.log("Dette er uri: " + uri);
45         })
46     }
47
48 }