Commit f224770a authored by Maxime REYROLLE's avatar Maxime REYROLLE

implements dashboard component

parent 49ef62e9
<p>
dashboard works!
</p>
<ul *ngFor="let service of servicesData" class="services">
<li><a href="{{service.url}}">{{service.name}}</a>
<ul *ngFor="let data of service.data">
<li>
<a href="{{data.link}}">{{data.label}}</a>
</li>
</ul>
</li>
</ul>
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
import {DashboardService} from '../shared/dashboard.service';
import {ActivatedRoute} from '@angular/router';
@Component({
selector: 'app-dashboard',
......@@ -6,10 +9,21 @@ import { Component, OnInit } from '@angular/core';
styleUrls: ['./dashboard.component.css']
})
export class DashboardComponent implements OnInit {
servicesData;
constructor() { }
constructor(private dashboardService: DashboardService, private route: ActivatedRoute) {
}
ngOnInit() {
this.route.params.subscribe(params => {
if (!params['local_government_id']) {
return;
}
this.dashboardService.getDataFromServices(params['local_government_id'])
.subscribe(servicesData => {
this.servicesData = servicesData.services;
});
});
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment