I am currently working on a function that toggles the display of a button based on data retrieved from an external API.
When loading a record, I pass in an 'id' parameter ($stateParams.id)
If the value of this parameter is 1, a button will be shown that triggers a function to set it to 0. If the value is 0, the button displayed affects the function to change it to 1.
The functionality of these functions is intact; however, I aim to have the page reload dynamically after the implementation of these functions so that the button reflects the changes made. Interestingly, if I navigate away from the page and return or switch states, the button updates correctly.
To trigger a reload after running the functions, I attempted using the code below but encountered no response, not even an error message:
$state.go($state.current, {id : $stateParams.id}, {reload: true});