Press "Enter" to skip to content

🔛 Angular 5+ Detect Online/Offline State Javascript

ngx online status is an Angular 5+ Module to track online and offline state.

online offline status, navigator online javascript, navigator online not working, onlineoffline indicator css, react check online status, navigator online not working in android

Slim Progress Bars Library For Vanilla JavaScript | qier-progress

How to make use of it:

Install

npm install ngx-online-status --save

Import OnlineStatusModule to your module.

import { OnlineStatusModule } from 'ngx-online-status';

@NgModule({
  declarations: [
    // ...
  ],
  imports: [
    OnlineStatusModule
  ],
  providers: [
    //...
  ]
})

Inject OnlineStatusService and use it:

import { OnlineStatusService, OnlineStatusType } from 'ngx-online-status';

export class AppComponent {
  status: OnlineStatusType;

  constructor(private onlineStatusService: OnlineStatusService) {
    this.onlineStatusService.status.subscribe((status: OnlineStatusType) => {
      // use status
      this.status = status;
    });
  }
}

Detect Online/Offline State, ngx online status Plugin/Github


See Demo And Download

Official Website(VadimDez): Click Here

This superior jQuery/javascript plugin is developed by VadimDez. For extra Advanced Usages, please go to the official website.

Be First to Comment

    Leave a Reply

    Your email address will not be published. Required fields are marked *