import { Injectable } from '@angular/core' ; @ Injectable ( { providedIn : 'root' , } ) export class SessionService { param key param value setItem ( key , value ) { sessionStorage . setItem ( key , JSON . stringify ( value ) ) ; } param key getItem ( key ) { var value = sessionStorage . getItem ( key ) ; return JSON . parse ( value ) ; } param key removeItem ( key ) { sessionStorage . removeItem ( key ) ; } /**
     * remove all session storage items
     */ clear ( ) { sessionStorage . clear ( ) ; } }