Introduction
In my extensive angular application, there are numerous forms for various items.
These forms are associated with action objects that have unique schemaforms.
The dropdowns in these forms vary based on the specific action and its parent company.
Previously, the dropdown contents were not updating without a page reload.
Key Concern
How can I trigger a window reload followed by a state.go change?
Code Snippet
$scope.goToActionWizardFull = function(CUuid, AUuid) {
$window.location.reload();
$state.go('actionWizard', { companyUuid: CUuid, uuid: AUuid });
}
Current Issue
This code is intended to clear the previous schema data from cookies/local storage to display the correct dropdown contents for the current action. Then, it should navigate to the new action's page.
However, instead of performing as expected, this code redirects users to the actionWizard page then back to the company page.
Additional Information
The dropdown content is fetched from sharedVars file:
.controller('ActionController', function ($scope, $stateParams, $state, $window, sharedVars, Company, Action) {
Accessed here:
$scope.actionSchema = sharedVars.getActionSchema();
Modified here:
$scope.actionSchema.properties.RDAInput.items.properties.input_location.enum = $scope.actionSchema.properties.RDAInput.items.properties.input_location.enum.concat(eachRDSchemaProperty['name'])
Subsequently, the form is loaded.
All of this utilizes
Update 2
Complete HTML form snippet:
<form sf-schema="actionSchema" sf-form="actionForm" sf-model="actionModel" name="submittableActionForm">
</form>
Update 3
Details from my bower.json file:
{
"name": "isp",
"appPath": "src/main/web",
"moduleName": "ispApp",
"version": "0.0.1",
"dependencies": {
"jquery": "2.1.1",
"angular": "1.6.1",
...
...
Latest Update
I have posted a related query on Stack Overflow that delves deeper into this issue: Reload a pages cache, then go to a new page