0

I`m new to angularJS. So if I have this design app:

MainView.html(Controller1)

    SecondView.html(Controller2)

        3rdView1.html(Controller3.1)     3rdView2.html(Controller3.2)

How do I refresh the MainView.html, from Controler 3.1 / 3.2 ? I tried $location.path and didn`t work. Any advice ?

que1326
  • 2,227
  • 4
  • 41
  • 58
  • 2
    Why do you need to do that? I suspect there's something in MainView that should be bound to a service shared by the other controllers of 3rdView1 and 3rdView2 –  Aug 28 '15 at 14:01
  • Use the $routeProvider and the ng-view... – Leo Javier Aug 28 '15 at 14:12

2 Answers2

0

You can do

$window.location = '/';

(inject $window on your controller)

Joao Polo
  • 2,153
  • 1
  • 17
  • 26
0

How to reload or re-render the entire page using AngularJS

$route.reload() will reinitialise the controllers but not the services. If you want to reset the whole state of your application you can use:

$window.location.reload();
Community
  • 1
  • 1
que1326
  • 2,227
  • 4
  • 41
  • 58