Skip to content

Instantly share code, notes, and snippets.

View enappd's full-sized avatar

Enappd enappd

View GitHub Profile
@enappd
enappd / http-client.page.ts
Last active July 31, 2021 16:28
Ionic http calls demo - Angular HttpClient
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 / ionic-native.page.ts
Created July 31, 2021 16:26
Ionic http calls demo - Ionic Native Http (cordova)
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 / index.js
Created July 31, 2021 14:37
Ionic http calls demo - Firebase functions
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 (partial)
Last active July 26, 2021 18:49
Ionic Angular Capacitor Google Login
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { GoogleAuth } from '@codetrix-studio/capacitor-google-auth';
@Component({
selector: 'app-landing',
templateUrl: './landing.page.html',
styleUrls: ['./landing.page.scss'],
})
export class LandingPage implements OnInit {
@enappd
enappd / landing.page.ts
Last active July 26, 2021 18:36
Ionic Angular Capacitor Google Login
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 July 26, 2021 17:51
Ionic Angular Capacitor Google Login
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) { }
@enappd
enappd / home.page.ts (partial)
Last active July 26, 2021 17:51
Ionic Angular Capacitor Google Login
import { Component } from '@angular/core';
import { GoogleAuth } from '@codetrix-studio/capacitor-google-auth';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
constructor() { }
ionViewDidEnter() {
@enappd
enappd / paypal.page.ts
Last active June 10, 2021 07:47
Payment function for Ionic 4 PayPal plugin
import { Component } from '@angular/core';
import { PayPal, PayPalPayment, PayPalConfiguration } from '@ionic-native/paypal/ngx';
@Component({
selector: 'app-paypal',
templateUrl: 'paypal.page.html',
styleUrls: ['paypal.page.scss'],
})
export class PaypalPage {
constructor(private payPal: PayPal) {
@enappd
enappd / Page.vue
Created June 7, 2021 04:19
Ionic Vue new app
<script lang="ts">
import { defineComponent } from 'vue';
import { IonButton, IonPage , alertController} from '@ionic/vue';
import { useRouter } from "vue-router";
export default defineComponent({
name: 'Page',
components: {
IonPage,
IonButton
},
@enappd
enappd / Home.vue
Created June 7, 2021 04:08
Ionic Vue New App
<template>
<ion-page>
<ion-header :translucent="true">
<ion-toolbar>
<ion-title>Home Page</ion-title>
</ion-toolbar>
</ion-header>
<ion-content :fullscreen="true">
<ion-header collapse="condense">