Skip to content

Instantly share code, notes, and snippets.

View shaharyar123's full-sized avatar
🏊‍♀️
diving into Js

Muhammad Shaharyar shaharyar123

🏊‍♀️
diving into Js
View GitHub Profile
const MyPage = (props) => {
return (
<div>
<div id="title">My Test Page</div>
{data.map((component, i) => {
<>
<h3> : {component.heading} </h3>
<div key={i}>
<MyComponent component={component} />
</div>
@shaharyar123
shaharyar123 / localstorage.module.ts
Created August 23, 2019 12:28
Local storage provider
import { LocalStorageService } from '../services/local-storage.service';
import { NgModule, ModuleWithProviders } from '@angular/core';
import { Platform } from '@ionic/angular';
import { LocalStorageMobileService } from '../services/local-storage-mobile.service';
import { LocalStorageBrowserService } from '../services/local-storage-browser.service';
import { CookieService } from 'ngx-cookie-service';
const storageServiceFactory = (platform: Platform, cookieService: CookieService) => (
platform.is('cordova') ? new LocalStorageMobileService() : new LocalStorageBrowserService(cookieService)
);