Answers for "angular local storage"


local storage javascript

function createItem() {
	localStorage.setItem('nameOfItem', 'value'); 
createItem() // Creates a item named 'nameOfItem' and stores a value of 'value'

function getValue() {
	return localStorage.getItem('nameOfItem');  
} // Gets the value of 'nameOfItem' and returns it
console.log(getValue()); //'value';
Posted by: Guest on April-26-2020

angular local storage

localStorage.setItem('dataSource', this.dataSource.length); // setting
console.log(localStorage.getItem('dataSource')); // getting
Posted by: Guest on May-30-2020

local storage javascript

localStorage.setItem('user_name', 'Rohit'); //store a key/value
var retrievedUsername = localStorage.getItem('user_name'); //retrieve the key
Posted by: Guest on October-23-2019

Code answers related to "Javascript"

Browse Popular Code Answers by Language