How do I prevent certain states from being loaded if application is opened from window reload/F5 key using AngularJs 1.6 and UI-Router with Html5 mode enabled.
Part of my UI-Router configuration:
.state("recordform", {
url: "/form/:formid/:recordid",
templateUrl: "Form.html",
})
.state("modalform", {
parent: "RecordForm",
url: "/modalform/:modalformid/:modalrecordid",
templateUrl: "ModalForm.html"
})
I need to prevent loading "modalform" state if page is opened by pasting link or F5 in browser.
The "modalform" state is opened in modal window which I don't want to open on page reload. The state should be accessible manually after refresh event is over.
I tried to check in "root" state if there is certain string in url but root seems to don't know about other states but himself.
I could also check in "modalform" controller if the state is opened from F5 but I don't know how to do that.