Currently, I am facing a challenge with my Cordova/AngularJS mobile application as I struggle to refresh the current state with new data.
Please be aware that this is not an Ionic Framework application.
The issue arises in the part of my app where I need to display questions for the user to answer. There are two types of questions: select
and draganddrop
. Each question type has its own controller - selectCtrl
and draganddropCtrl
, each tied to specific views.
The problem occurs when questions of the same type appear one after another. I need to reload the current state and controller with fresh values and options for the new question.
I have tried various solutions found online, such as:
$state.transitionTo($state.current, $state.$current.params, {
reload: true, inherit: true, notify: true
});
and..
$state.reload() //although there are reported issues with this method
and even resorted to the traditional approach of..
window.location.reload(true)
All these attempts redirect the user to my welcomeCtrl
, which is the first controller that loads after login.
This behavior is confusing to me. Any assistance on this matter would be highly appreciated.
Thank you.