angular service save data to localstorage 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