NG-NETWORK-STATUS
ng-network-status will help you to add events when app is going online/offline.
Examples
Usage
Take a look at the example project
Install package
npm install --save ng-network-status
Add NgNetworkStatusModule to your AppModule
;; ; // <-- HERE ; @
Use NetworkStatusService in your components
; // Import NetworkStatusService; @ implements OnInit networkStatus = "Online"; // Inject NetworkStatusService instance {} { // Register health check thisnetworkStatusService; // Subscribe on network status change event thisnetworkStatusServiceisOnline; }
Available options
healthCheck
method signature
public ;
You can configure interval and grayscale effect options.
thisnetworkStatusService;
Default option values
Default interval is 1000ms
and default options is
defaultOptions = grayscale: enabled: true animationDuration: 03 percentage: 09 ;
License
ng-network-status is released under the MIT License.