I am working on an angular web page on which I have used angular material controls. I have a md select control which I have defined as follows:
<md-select ng-model="organization" required="true" name="organization">
<md-option value="">Organization</md-option>
<md-option ng-repeat="organization in organizationDescriptions" value="{{organization.text}}">
{{organization.text}}
</md-option>
</md-select>
This lives on a parent form whose $invalid property controls the behavior of a button. Whenever I select a value from the dropdown, the form becomes valid and the button is activated. If there is no value selected then the button is disabled.
However, I also implemented local storage using ngstorage. What this does, is that it automatically manages the state of the properties of the scope and saves them into the local storage of the browser. This means that whenever I refresh the page the same dropdown value is selected. This works completely fine.
However when performing a refresh, the $invalid property of the form is now set to true (even though the md select value is correctly set). How can I solve this?