i am working on ionic and used localstorage(simple html local storage function)set value in localStroage
window.localStorage['Invite-Code'] = $scope.passCode;
above code set the value in local storage.
var val = window.localStorage['Invite-Code'] || false;
above code show the value of localstorage value, if exist or not then its return value true or false. here 'Invite-Code' is key