import { Injectable } from '@angular/core'; import { CookieService } from 'ngx-cookie'; @Injectable() export class StoreService { constructor(private cookieService: CookieService) { } getStore(): string { return (typeof document !== 'undefined') && this.cookieService.get('store') ? this.cookieService.get('store') : null; } }