0.1.0 • Published 5 years ago

ng-net-status v0.1.0

Weekly downloads
12
License
MIT
Repository
github
Last release
5 years ago

NgNetStatus

An angular directive which checks availability of network connection.

Installing

$ npm install ng-net-status --save

Basic usage

Import NgNetStatusModule into your ngModule and start using directives ngOnline and ngOffline within your html component.

app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { NgNetStatusModule } from 'ng-net-status';

import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    NgNetStatusModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
app.component.html
<div ngOnline>Hey! You are online</div>
<div ngOffline>You're offline. Check your connection!</div>