import { Component, Input, OnInit }      from "@angular/core"
import { ActivatedRoute, Params }        from '@angular/router'

@Component({
    moduleId: module.id+ '',
    selector: 'store-info',
    templateUrl: './tpl.store-info.pug',
    styleUrls: ['./sty.store-info.scss']
})

export class StorelocatorStoreInfoComponent {

    @Input('store') store: any;
    currentStore: string;
    constructor(
        private _route: ActivatedRoute
    ) { }

    ngOnInit() {
        this._route.params.subscribe((params: any) => {
            this.currentStore = params.store;
        })
    }

    hasHttp(url: string) {
        if(url.indexOf('http') == -1) {
            url = 'http://'+url
        } 


        return url;
    }
}