All Projects → hsuanxyz → ionic2-pincode-input

hsuanxyz / ionic2-pincode-input

Licence: MIT license
🔒 A pincode input for ionic2

Programming Languages

typescript
32286 projects
CSS
56736 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to ionic2-pincode-input

MyDiary
A real-world mobile app implementation inspired by the movie "Your Name". 🌠
Stars: ✭ 23 (-60.34%)
Mutual labels:  ionic2
Ionic2-NutritionSample
Ionic2 to show the use of http in an application - IonicFramework - angular2
Stars: ✭ 19 (-67.24%)
Mutual labels:  ionic2
ionic-manup
Mandatory Update for Ionic
Stars: ✭ 57 (-1.72%)
Mutual labels:  ionic2
chihu
ionic2-example <吃乎>一款美食app 🍜 ☕️ 🍦 (This is a support android and apple ionic2 case, a food app)
Stars: ✭ 64 (+10.34%)
Mutual labels:  ionic2
ionic3-image-handling
In this ionic tutorial you will learn how to access the image gallery and take pictures from an ionic app. Also we will show you how to add a image cropper. This ionic tutorial includes a working ionic app example you can reuse for your needs.
Stars: ✭ 35 (-39.66%)
Mutual labels:  ionic2
ionic-hockeyapp
Need HockeyApp in your Ionic application, add this package!
Stars: ✭ 19 (-67.24%)
Mutual labels:  ionic2
ionic-dark-grey-theme
Dark Theme for ionic2 (ionic-conference-app as example)
Stars: ✭ 29 (-50%)
Mutual labels:  ionic2
gl-ionic2-env-configuration
An Ionic2 Service to load an environment specific configuration before everything else
Stars: ✭ 23 (-60.34%)
Mutual labels:  ionic2
sm-coal-app
这是一个使用Ionic2开发的集数据展示,交易,交流于一体的APP
Stars: ✭ 21 (-63.79%)
Mutual labels:  ionic2
build ionic2 app chinese
this is the chinese version of <build ionic2 app chinese>
Stars: ✭ 16 (-72.41%)
Mutual labels:  ionic2
ionic3
This repository contains complete source code for Ionic 3 tutorial from https://ampersandacademy.com/tutorials/ionic-framework-3. I will try many Ionic 3 specific scripts and will write them as separate tutorial. You can follow this repo to get more tested and working script for the Ionic 3.
Stars: ✭ 21 (-63.79%)
Mutual labels:  ionic2
Dianoia-app
Mobile (Ionic 3 - Angular 4) app about non-pharmaceutical activities and information for people with dementia.
Stars: ✭ 13 (-77.59%)
Mutual labels:  ionic2
ionic-video-chat-support
Ionic 3 Video and Group Text Chat
Stars: ✭ 19 (-67.24%)
Mutual labels:  ionic2
ionic2-PreDB
Simple Ionic 2+ with pre-populated database starter project
Stars: ✭ 14 (-75.86%)
Mutual labels:  ionic2
vue-pincode-input
Great pincode input component
Stars: ✭ 128 (+120.69%)
Mutual labels:  pincode
ionic2 firebase shopping cart
Shopping cart built using Ionic2 and Firebase
Stars: ✭ 21 (-63.79%)
Mutual labels:  ionic2
ionic-socialsharing-with-deeplinking-example
Ionic Social Sharing and Deep Linking example app. Complete Ionic Tutorial with free example app! Built for Ionic 3.
Stars: ✭ 16 (-72.41%)
Mutual labels:  ionic2
React-Pincode
A NPM module which auto fills City, District and State fields when a valid Zip Code in entered!
Stars: ✭ 26 (-55.17%)
Mutual labels:  pincode
ionicfirebasecrud
An example of crud with Firebase and Ionic
Stars: ✭ 15 (-74.14%)
Mutual labels:  ionic2
ionic-material-icons
Over 900 Material lcons for Ionic 2+ Apps
Stars: ✭ 27 (-53.45%)
Mutual labels:  ionic2

ionic2-pincode-input

Dependency Status NPM version Downloads MIT License

A pin-code input for ionic2

中文文档 live demo

v

Installation

$ npm install ionic2-pincode-input --save
$ npm install @angular/animations --save

Usage

app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';

...

import { PincodeInputModule } from  'ionic2-pincode-input';

@NgModule({
  ...
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    PincodeInputModule,
    IonicModule.forRoot(MyApp)
  ]
  ...
})
export class AppModule {}

your-page.ts

import { Component } from '@angular/core';

import { NavController } from 'ionic-angular';
import { PincodeController } from  'ionic2-pincode-input/dist/pincode'
@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  code:string;

  constructor(
    public navCtrl: NavController,
    public pincodeCtrl: PincodeController,
  ) {
  }

  openPinCode():any{

    let pinCode =  this.pincodeCtrl.create({
      title:'Pincode'
    });

    pinCode.present();

    pinCode.onDidDismiss( (code,status) => {

      if(status === 'done'){

        this.code = code;
      }else if (status === 'forgot'){

        // forgot password
      }

    })

  }

}

pinHandler example

import { Component } from '@angular/core';

import { NavController } from 'ionic-angular';
import { PincodeController } from  'ionic2-pincode-input/dist/pincode'

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  code:string;
  private handlePIN: (pincode: string) => Promise<any> = (pincode: string) => {
      if (pincode === '123456') {
        // Do something
        console.log('Too easy');
        return Promise.reject('');
      } else {
        // Do something
        return Promise.resolve();
      }
    };

  constructor(
    public navCtrl: NavController,
    public pincodeCtrl: PincodeController,
  ) {

  }
  
  openPinCode():any{

    let pinCode =  this.pincodeCtrl.create({
      title:'Pincode',
      pinHandler: this.handlePIN
    });

    pinCode.present();

    pinCode.onDidDismiss( (code,status) => {

      if (status === 'forgot'){

        // forgot password
      }

    })

  }

}

create(PincodeOpt)

PincodeOpt

Name Type Default Description
cssClass string '' separated by spaces
passSize number 6 your password size
title String 'password' title
cancelButtonText String 'cancel' cancel button text
encoded Function (c) => {return c} your encoded pin code function
forgotPasswordText String 'forgot password' forgot password text
hideToolbar Boolean false is hide toolbar
hideForgotPassword Boolean false is hide forgot password button
hideCancelButton Boolean false is hide cancel button
enableBackdropDismiss Boolean true Whether the alert should be dismissed by tapping the backdrop.
pinHandler PincodePinHandler (pin: string): Promise<any> null Callback called when the PIN is complete. Returns a Promise which resolves if the PIN is valid.
visibility Boolean false is show pin-code
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].