ng-net-status
v0.1.0
Published
An angular directive which checks availability of network connection.
Downloads
21
Maintainers
Readme
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>