0

I have ng-route:

.when('/home', { 
    templateUrl: "/view/pages/home.html",
    controller: "homeController",
    controllerAs: 'home',
    caseInsensitiveMatch: true,
    resolve: myResolve
})

After I disconnect the internet, to simulate network issues, angular is throwing an error: Failed to load template: /view/pages/home.html

And after I connect internet again, angular is not trying to reload view. How can I tell angular, to keep trying to load view.

Pikachu
  • 1,973
  • 3
  • 20
  • 27
  • Possible duplicate of [How to check internet connection in AngularJs](http://stackoverflow.com/questions/16242389/how-to-check-internet-connection-in-angularjs) – nalply Feb 05 '16 at 11:48

1 Answers1

0

Angular will fire on page load. If the internet connection goes away, and then is reconnected on the same page. The application will not try and reload the page. The user would then have to try to navigate to a new page or new resource. This would cause the application to load again.

Not to mention that the application is run in the browser, but in order to load the controller into the user's browser. The user must have an internet connection.

  • 1
    The OP gets that, they are trying to know how to tell angular to load it again once the internet connects again... – Ruan Mendes Dec 13 '14 at 22:27
  • 1
    I believe this answer from stack exchange is what you are looking for. http://stackoverflow.com/questions/16242389/how-to-check-internet-connection-in-angularjs – Adobe Flex Coder 0622 Dec 13 '14 at 22:37
  • Well I now know online and offline events. But still don't know how to tell angular, to not load view, until user won't be online. – Pikachu Dec 14 '14 at 12:03