set and get localstorage in angular 6 code example
Example: angular local storage
localStorage.setItem('dataSource', this.dataSource.length); // setting
console.log(localStorage.getItem('dataSource')); // getting
localStorage.setItem('dataSource', this.dataSource.length); // setting
console.log(localStorage.getItem('dataSource')); // getting