[sidebar] Showing basic information on side panel
[u/erikhf/frm.git] / src / components / sidebar / sidebar.ts
CommitLineData
c1cf798d 1import {Component, NgFor, NgIf, NgModel, CORE_DIRECTIVES,FORM_DIRECTIVES} from 'angular2/angular2';
ebe03648
EHF
2import {Http} from 'angular2/http';
3
4
5@Component({
6 selector: 'mou-sidebar',
c1cf798d 7 directives: [CORE_DIRECTIVES,FORM_DIRECTIVES,NgFor,NgModel,NgIf],
ebe03648
EHF
8 templateUrl: './components/sidebar/sidebar.html'
9})
10export class Sidebar {
11 http: Http;
c1cf798d
EHF
12 activeOrgUnit: Object;
13 editmode: boolean;
ebe03648
EHF
14
15 constructor(http:Http){
16 this.http = http;
c1cf798d
EHF
17 editmode = false;
18 }
19
20 update(orgunitId){
21 console.log(orgunitId);
22 this.http.get(dhisAPI + "/api/organisationUnits/" + orgunitId)
23 .map(res => res.json())
24 .subscribe(res => this.activeOrgUnit = res)
ebe03648
EHF
25 }
26}
27