import { Component, OnInit, ViewChild, ElementRef } from '@angular/core'
import { ActivatedRoute, Router, ParamMap } from '@angular/router'
import { ConfigService } from '../../config.service'

@Component({
    selector: 'gisaf-measures-home',
    template: '<p>Select a data store</p>',
})
export class MeasuresHomeComponent implements OnInit {
    constructor(
        public configService: ConfigService,
        private router: Router
    ) {}
    ngOnInit() {
        const defaultStore = this.configService.conf['measures']['defaultStore']
        if (defaultStore) {
            this.router.navigate(['/measures', defaultStore])
        }
    }
}