I am trying to save values in Angular session storage within an Angular directive, but I am facing an issue where I only receive NULL. Can anyone provide assistance?
app.directive('myDirective', function (httpPostFactory) {
return {
restrict: 'A',
scope: true,
link: function (scope, element, attr) {
element.bind('change', function ()
{
sessionStorage.setItem("ID","I'm a value saved with SessionStorage");
console.log(sessionStorage.getItem("SavedString"))
});
}
};
});