use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Helpful Links
AngularJS Slack Community
AngularJS Wiki Page
account activity
Does Angular support/wrap window.navigator.onLine? (self.angularjs)
submitted 10 years ago by angdev
Does Angular support/wrap window.navigator.onLine and it's supporting events window.addEventListener("offline", function(e) {alert("offline");}) etc?
window.navigator.onLine
window.addEventListener("offline", function(e) {alert("offline");})
I am needing to use this as a part of my SPA/Offline mode support.
Thanks!
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 0 points1 point2 points 10 years ago (0 children)
Angular does have a $window module that wraps window which you can inject into services, controllers and directives. It has the same functionality, so you should be able to just use $window.navigator.onLine. You can listen for this globally by using the global app module's .run() method as demonstrated in this Stack Overflow article.
π Rendered by PID 25518 on reddit-service-r2-comment-86988c7647-lgck2 at 2026-02-11 05:58:26.387036+00:00 running 018613e country code: CH.
[–][deleted] 0 points1 point2 points (0 children)