Skip to content

Instantly share code, notes, and snippets.

View enappd's full-sized avatar

Enappd enappd

View GitHub Profile
@enappd
enappd / app.module.ts
Last active March 13, 2019 06:29
Setup ngx-translate and http-loader in app.module.ts
import { NgModule, ErrorHandler } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouteReuseStrategy } from '@angular/router';
import { HttpClientModule, HttpClient } from '@angular/common/http';
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';
@enappd
enappd / tab1.page.ts
Last active March 13, 2019 07:51
Loading translateService in component and implementing functions
import { Component } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'app-tab1',
templateUrl: 'tab1.page.html',
styleUrls: ['tab1.page.scss']
})
export class Tab1Page {
//local variables
@enappd
enappd / tab1.page.html
Created March 13, 2019 08:05
HTML layout for translation text and change translation option
<ion-header>
<ion-toolbar>
<ion-title>
Tab One
</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
@enappd
enappd / tab1.module.ts
Created March 13, 2019 08:15
Import translation library in Child module
import { IonicModule } from '@ionic/angular';
import { RouterModule } from '@angular/router';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Tab1Page } from './tab1.page';
import { TranslateModule, TranslateLoader} from '@ngx-translate/core';
import { HttpClient } from '@angular/common/http';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
@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 / paypal.page.html
Last active May 9, 2019 18:28
HTML template for Ionic 4 PayPal integration page
<ion-header>
<ion-toolbar color="primary">
<ion-buttons slot="start">
<ion-menu-button></ion-menu-button>
</ion-buttons>
<ion-title>
Paypal for App
</ion-title>
</ion-toolbar>
</ion-header>
@enappd
enappd / paypal.page.ts
Created May 9, 2019 18:05
Ionic 4 PWA Paypal payment implementation
import { Component } from '@angular/core';
@Component({
selector: 'app-paypal',
templateUrl: 'paypal.page.html',
styleUrls: ['paypal.page.scss'],
})
export class PaypalPage {
paymentAmount: string = '3.33';
currency: string = 'USD';
@enappd
enappd / album.index.js
Created May 9, 2019 18:55
JS file for album page in Spotify React Native app
/**
* Audrix (https://www.enappd.com/audrix)
*
* Copyright © 2018-present Enappd. All rights reserved.
*
* This source code is licensed as per the terms found in the
* LICENSE.md file in the root directory of this source tree.
*/
import React, { Component } from "react";
@enappd
enappd / stripe.page.ts
Created May 12, 2019 10:29
Ionic Stripe Native payment function
payWithStripe() {
this.stripe.setPublishableKey(this.stripe_key);
this.cardDetails = {
number: '4242424242424242',
expMonth: 12,
expYear: 2020,
cvc: '220'
}
@enappd
enappd / stripe.page.html
Created May 12, 2019 11:11
Stripe elements HTML
<ion-header>
<ion-toolbar color="primary">
<ion-buttons slot="start">
<ion-menu-button></ion-menu-button>
</ion-buttons>
<ion-title>
Stripe for PWA
</ion-title>
</ion-toolbar>
</ion-header>