Currently in the process of building a webpage with the MEAN stack, I utilized the HTML5/Javascript sessionStorage variable to store the user data for access across all pages.
Now, the challenge is passing this data into angularJS through the controller without requiring the user to input the value again. Attempts to set the username field as readonly and assign the value using getElementByID were unsuccessful, as angularJS continued to retrieve the old value of "". This occurred because the initial text field value was empty, resulting in an undefined user in the angularJS scope.
Another strategy was to pass the value as a hidden scope, but this approach also failed due to angular's constraints.
Is there a simpler method to declare the variable within ng-model? The underlying issue is that any ng value assumes "", interpreting "user" solely as the text "user" rather than a variable.
Any assistance on this matter would be greatly valued.