Skip to content

Instantly share code, notes, and snippets.

View sandy912's full-sized avatar
🏠
Working from home. Frontend Developer

Santhosh Sandy sandy912

🏠
Working from home. Frontend Developer
View GitHub Profile
@sandy912
sandy912 / any.service.ts
Created January 14, 2019 12:53
[Local Storage in Ionic] For storing and retriving the values loacally when no connection
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { NetworkService, ConnectionStatus } from './network.service';
import { Storage } from '@ionic/storage';
import { Observable, from } from 'rxjs';
import { tap, map } from "rxjs/operators";
const API_STORAGE_KEY = 'specialkey';
export class YoutubeService {
@sandy912
sandy912 / Network.service.ts
Created January 14, 2019 12:48
[Ionic 4 network service] Just plug this service into your ionic app for checking the network connection inside the app or while starting the app #ionic #network #ionicnetwork
import { Injectable } from '@angular/core';
import { Network } from '@ionic-native/network/ngx'
import { BehaviorSubject, Observable } from 'rxjs';
import { ToastController, Platform } from '@ionic/angular';
export enum ConnectionStatus {
Online,
Offline
}