Last active
June 18, 2017 14:35
-
-
Save kauffmanes/cd9d6ddf5c8a82cb9b74f18579421b0b to your computer and use it in GitHub Desktop.
v3 app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Parses and saves to localStorage | |
$scope.save = function () { | |
var stringCopy = ''; | |
//lc only accepts strings | |
//allows us to reference this lc record later | |
$scope.formData.lcKey = Date.now().toString(); | |
try { | |
stringCopy = JSON.stringify($scope.formData); | |
} catch (err) { | |
//error handling for bad form submission | |
console.debug(err); | |
return; | |
} | |
localStorage[$scope.formData.lcKey] = stringCopy; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment