import { Inject , Injectable } from '@angular/core' ; import { SESSION_STORAGE , StorageService } from 'ngx-webstorage-service' ; const STORAGE_KEY = 'simple-alerts-session' ; @ Injectable ( ) export class SessionStorageService { constructor ( @ Inject ( SESSION_STORAGE ) private storage ) { } public setSessionData ( userSession ) { this . storage . set ( STORAGE_KEY , userSession ) ; } public getSessionData ( ) { return this . storage . get ( STORAGE_KEY ) ; } }