Ok, I\'ve tried to follow examples here, I know there might be a few different ways of adding objects to an array in localstorage and not overwriting it but I\'m failing to
adding objects to array in localStorage (Ionic):
var existingEntries = JSON.parse(localStorage.getItem("allEntries"));
if(existingEntries == null) existingEntries = [];
var testObject ={username:this.username,
mobile:this.mobile,
email:this.email,
type:this.type,
password:this.password};
localStorage.setItem('testObject', JSON.stringify(testObject));
existingEntries.push(testObject);
localStorage.setItem("allEntries", JSON.stringify(existingEntries));