Skip to content

Instantly share code, notes, and snippets.

Avatar

Enappd enappd

View GitHub Profile
@enappd
enappd / Home.page.html
Last active Jun 27, 2022
TomTom Maps in Ionic Capacitor App
View Home.page.html
<ion-header [translucent]="true">
<ion-toolbar color="primary">
<ion-title>
TomTom Maps
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<div #map id="map"></div>
@enappd
enappd / cap-http.page.ts
Created Jul 31, 2021
Ionic http calls demo - Capacitor Http
View cap-http.page.ts
import { Component, OnInit } from '@angular/core';
import { Platform } from '@ionic/angular';
import { Http, HttpResponse } from '@capacitor-community/http';
@Component({
selector: 'app-cap-http',
templateUrl: './cap-http.page.html',
styleUrls: ['./cap-http.page.scss'],
})
export class CapHttpPage{
plt: string;
@enappd
enappd / ionic-native-adv.page.ts
Created Jul 31, 2021
Ionic http calls demo - Ionic Native Advanced
View ionic-native-adv.page.ts
import { Component, OnInit } from '@angular/core';
import { Platform } from '@ionic/angular';
import { HttpClient } from '@angular/common/http';
@Component({
selector: 'app-ionic-native-adv',
templateUrl: './ionic-native-adv.page.html',
styleUrls: ['./ionic-native-adv.page.scss'],
})
export class IonicNativeAdvPage{
@enappd
enappd / app.module.ts
Created Jul 31, 2021
Ionic http calls demo - Ionic Native Advanced
View app.module.ts
import { NgModule } from '@angular/core';
import { HttpBackend, HttpXhrBackend } from '@angular/common/http';
import { NativeHttpModule, NativeHttpBackend, NativeHttpFallback } from 'ionic-native-http-connection-backend';
import { Platform } from '@ionic/angular';
@NgModule({
declarations: [],
imports: [
NativeHttpModule
],
@enappd
enappd / ionic-native.page.ts
Created Jul 31, 2021
Ionic http calls demo - Ionic Native Http (cordova)
View ionic-native.page.ts
import { Component, OnInit } from '@angular/core';
import { Platform } from '@ionic/angular';
import { HTTP } from '@ionic-native/http/ngx';
@Component({
selector: 'app-ionic-native',
templateUrl: './ionic-native.page.html',
styleUrls: ['./ionic-native.page.scss'],
})
export class IonicNativePage {
@enappd
enappd / http-client.page.ts
Last active Jul 31, 2021
Ionic http calls demo - Angular HttpClient
View http-client.page.ts
import { Component, OnInit } from '@angular/core';
import { Platform } from '@ionic/angular';
import { HttpClient } from '@angular/common/http';
@Component({
selector: 'app-http-client',
templateUrl: './http-client.page.html',
styleUrls: ['./http-client.page.scss'],
})
export class HttpClientPage {
@enappd
enappd / fetch.page.ts
Last active Jul 31, 2021
Ionic http calls demo - Fetch API
View fetch.page.ts
import { Component, OnInit } from '@angular/core';
import { Platform } from '@ionic/angular';
@Component({
selector: 'app-fetch',
templateUrl: './fetch.page.html',
styleUrls: ['./fetch.page.scss'],
})
export class FetchPage {
localhost:string = 'localhost';
plt: string;
@enappd
enappd / index.js
Created Jul 31, 2021
Ionic http calls demo - Firebase functions
View index.js
const functions = require('firebase-functions');
const cors = require('cors')({ origin: true });
exports._getData = functions.https.onRequest((request, response) => {
const res = { data: request.query.data || 'failed' };
response.send(res);
});
exports._postData = functions.https.onRequest((request, response) => {
const res = { data: request.body.data };
@enappd
enappd / landing.page.ts
Last active Jul 26, 2021
Ionic Angular Capacitor Google Login
View landing.page.ts
import { Component } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { GoogleAuth } from '@codetrix-studio/capacitor-google-auth';
import { Http } from '@capacitor-community/http';
@Component({
selector: 'app-landing',
templateUrl: './landing.page.html',
styleUrls: ['./landing.page.scss'],
})
@enappd
enappd / home.page.ts
Created Jul 26, 2021
Ionic Angular Capacitor Google Login
View home.page.ts
import { Component } from '@angular/core';
import { GoogleAuth } from '@codetrix-studio/capacitor-google-auth';
import { Router, NavigationExtras } from '@angular/router';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
constructor(private router: Router) { }