Skip to content

Instantly share code, notes, and snippets.

🤙
Ionic 4 lyfe

Max Lynch mlynch

🤙
Ionic 4 lyfe
Block or report user

Report or block mlynch

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ionic-vue-inputs.vue
/**
Ionic Vue 0.0.8-next prerelease adds support for v-model to all Ionic inputs.
To try it out, run
npm install @ionic/vue@next
*/
<template>
<div class="ion-page">
<ion-header>
View menu.html
<ion-split-pane>
<ion-menu [content]="nav" side="start"...>
</ion-menu>
<ion-nav [root]="rootPage" #nav main></ion-nav>
</ion-split-pane>
@mlynch
mlynch / generate.js
Last active Feb 7, 2019
Stencil component generator
View generate.js
/*
To setup, place in scripts/generate.js and add
"st:generate": "node scripts/generate.js"
To your npm scripts.
To generate a component in src/components/ run
npm run st:generate component my-component
@mlynch
mlynch / cordova-plugin-guide.md
Last active Sep 10, 2019
Cordova Plugin Developer Guide
View cordova-plugin-guide.md

Cordova Plugin Development Guide (iOS and Android)

Version: 0.0.1 updated 7/1/2016

Cordova Plugins are the magic that enable our mobile web app content to access the full power of Native SDKs underneath, but through clean JavaScript APIs that work the same across all platforms we target.

Building Cordova plugins is scary for many Cordova and Ionic developers, but it doesn't have to be. This simple guide walks through the what, when, why, and how of Cordova plugin development for iOS and Android.

Introduction

View routes.js
.get('/apple-app-site-association', function(req, res) {
res.header('Content-Type', 'application/pkcs7-mime');
res.render('apple-app-site-association.txt');
})
View cordova.ts
const promisifyCordova = (pluginName:string, methodName:string) => {
return (...args) => {
return new Promise((resolve, reject) => {
cordova.exec(resolve, reject, pluginName, methodName, args);
})
}
}
const observablifyCordova = (pluginName:string, methodName:string, cleanUpMethodName?:string) => {
return (..args) => {
@mlynch
mlynch / info.plist
Last active Sep 20, 2019
Disable App Transport Security in iOS 9
View info.plist
<!--
This disables app transport security and allows non-HTTPS requests.
Note: it is not recommended to use non-HTTPS requests for sensitive data. A better
approach is to fix the non-secure resources. However, this patch will work in a pinch.
To apply the fix in your Ionic/Cordova app, edit the file located here:
platforms/ios/MyApp/MyApp-Info.plist
And add this XML right before the end of the file inside of the last </dict> entry:
@mlynch
mlynch / ionRadio.js
Last active Dec 27, 2016
ionRadio fix for iOS 9 bugs
View ionRadio.js
/**
* ionRadioFix - fixes a bug in iOS 9 UIWebView that breaks the tilde selector in CSS. To
* use this fix, include it after your Ionic bundle JS.
*
* Note: due to Angular directive override limitations, you'll need to change any reference
* to <ion-radio> to <ion-radio-fix> to apply this patched radio button.
*
* Also, make sure to add the new CSS from the second part of this gist.
*/
angular.module('ionic').directive('ionRadioFix', function() {
View app.plist
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key><true/>
</dict>
You can’t perform that action at this time.