javascript - ngStorage not storing data when being updated -
i building directive handles out courses, part of saving course data in local storage user can resume.
when data changes call function
function setlocalstorage(){ if(!preview){ $localstorage.scorm = scope.scorm } }
i call when first load course
my problem data not updated in local storage.
when debug can see $localstorage.scorm
getting updated in chrome console data in actual local storage unchanged.
solved using $apply
function setlocalstorage(){ if(!preview){ scope.$apply(function () { $localstorage.scorm = scope.scorm; }); } }
Comments
Post a Comment