MyWorkspace
This project was generated with Angular CLI version 12.2.10.
Table of Contents
About
this package used to detect offline and online status and show or hide messages based on network status
Imports
@NgModule({
declarations: [
AppComponent,
],
imports: [
...
NgofflineModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Usage
<ngoffline></ngoffline>
The default message is 'You are not connected', but you can change it
<ngoffline message="Custom message"></ngoffline>
You can use directive to display or hide any html selector
<div ngoffline>
this message will be displayed only if the status is offline
</div>
Network status output return 'false' if the status Offline
<ngoffline (isOnline)="checkNetworkStatus($event)"></ngoffline>
Or in the directive
<div ngoffline (isOnline)="checkNetworkStatus($event)">
this message will be displayed only if the status is offline
</div>