setitem localstorage angular code example
Example 1: angular local storage
localStorage.setItem('dataSource', this.dataSource.length); // setting
console.log(localStorage.getItem('dataSource')); // getting
Example 2: getitem localstorage
// localStorage--> userName: 'jon'
var userName = localStorage.getItem('userName');
// userName --> jon