reload the angularjs after update , date not updated

81 Views Asked by At

i am working in angularjs 1.i am trying to make CRUD in angularjs and laravel.i have successfully make the CRUD and CRUD is working fine , in my application their is child and parent routing present using ui router.At parents Route i have show the list of all the data and then by click on add new or edit button bootstrap modal appears , route change and after updating data , I change the route to parents route which works fine but the problems is with i update the data and try to reload the parent view , parents view does not update , remain same may be because of the angular store view in browser when every we call the view, then if you again call this view it will come from browser not from sever again.

How can i come back to the parent view with update data?

Thanks for Helping

this is my code i use to reload the the parents view , i parents do not update remain same although the route changes.

$location.path(ROUTE NAME);
$window.location.assign(ROUTE NAME);
$window.location.href = ROUTE NAME;
1

There are 1 best solutions below

1
Ramesh Rajendran On

Don't be think this is a solution for your question. Just think it would be a key for you.

At first store the parent values in local storage before reload the parent view

$localStorage.set("parant", $form) 

and after reload the page, check if local storage have data, then assign to your current form, like

if($localStorage.get("parant") != undefined)
{
  $form = $localStorage.get("parant") 
  return false;
}