Skip to content

Instantly share code, notes, and snippets.

View enappd's full-sized avatar

Enappd enappd

View GitHub Profile
@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 / 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 / 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">
@enappd
enappd / login.page.ts
Last active June 3, 2021 02:06
Ionic Read SMS with Retriever API
import { Component } from '@angular/core';
import { ToastController } from '@ionic/angular';
import { SmsRetriever } from '@ionic-native/sms-retriever/ngx';
import { Router } from '@angular/router';
@Component({
selector: 'app-login',
templateUrl: './login.page.html',
styleUrls: ['./login.page.scss'],
@enappd
enappd / invoice.component.ts
Created June 2, 2021 01:31
Ionic app PDF generation - PDF Download
import { Component, OnInit, Input } from '@angular/core';
import { ModalController } from '@ionic/angular';
import { PDFGenerator } from '@ionic-native/pdf-generator/ngx';
@Component({
selector: 'app-invoice',
templateUrl: './invoice.component.html',
styleUrls: ['./invoice.component.scss'],
})
export class InvoiceComponent implements OnInit {
@enappd
enappd / invoice.component.html
Created June 1, 2021 22:45
Ionic app PDF generation - PDF UI
<ion-header>
<ion-toolbar color="danger">
<ion-buttons (click)="closeModal()" slot="start">
<ion-button slot="icon">
<ion-icon class="icon" name="arrow-back-outline"></ion-icon>
</ion-button>
</ion-buttons>
<ion-title class="title-ios ion-text-capitalize">Order Invoice</ion-title>
</ion-toolbar>
</ion-header>
@enappd
enappd / home.page.ts
Created June 1, 2021 22:00
Ionic app PDF generation
import { Component } from '@angular/core';
import { environment } from '../../environments/environment';
import { InvoiceComponent } from '../components/invoice/invoice.component';
import { ModalController } from '@ionic/angular';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
@enappd
enappd / home.page.html
Last active June 1, 2021 21:39
Ionic app PDF generation - HTML
<ion-header>
<ion-toolbar color="danger">
<ion-buttons slot="start">
<ion-button slot="icon">
<ion-icon name="menu"></ion-icon>
</ion-button>
</ion-buttons>
<ion-title>
My Orders
</ion-title>
@enappd
enappd / environment.ts
Last active June 1, 2021 21:10
Dummy Order Data JSON
export const environment = {
production: false,
orderData: {
address: {
title: 'Home',
name: 'Maida',
flatNumber: 115,
street: 'Brighton Road',
locality: 'Brighton'
},