Socket
Socket
Sign inDemoInstall

@ionic-tools/emoji-picker

Package Overview
Dependencies
14
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ionic-tools/emoji-picker

Emoji picker for Ionic3


Version published
Maintainers
1
Install size
59.9 MB
Created

Readme

Source

npm version

Emoji picker for Ionic 3

This project was forked from the angular2-emoji-picker project created by lsharir

Installation

Install the module via NPM

npm i @ionic-tools/emoji-picker --save

Import it in your app's module(s)

Import EmojiPickerModule.forRoot() in your app's main module

app.module.ts

import { EmojiPickerModule } from '@ionic-tools/emoji-picker';

@NgModule({
    ...
    imports: [
      ...
      EmojiPickerModule.forRoot()
      ],
    ...
})
export class AppModule {}

If your app uses lazy loading, you need to import EmojiPickerModule in your shared module or child modules:

import { EmojiPickerModule } from '@ionic-tools/emoji-picker';

@NgModule({
    ...
    imports: [
      ...
      EmojiPickerModule
      ],
    ...
})
export class SharedModule {}

Sample

<ion-textarea [(ngModel)]="emojitext"></ion-textarea>

<button ion-button clear icon-only (click)="toggled = !toggled" [(emojiPickerIf)]="toggled" [emojiPickerDirection]="'top'"
      (emojiPickerSelect)="handleSelection($event)">
      🤗
</button>
toggled: boolean = false;
emojitext: string;

handleSelection(event) {
  this.emojitext = this.emojitext + " " + event.char;
}

Directive API:

<button ion-button
    (click)="toggled = !toggled"
    [(emojiPickerIf)]="toggled"
    [emojiPickerDirection]="'bottom' || 'top' || 'left' || 'right'"
    (emojiPickerSelect)="handleSelection($event)">😄</button>

Emitter (emojiPickerSelect)="handleSelection($event)"

$event = EmojiEvent{ char : "😌", label : "relieved" }

EmojiPickerCaretEmitter

added for your convenience, emits information regarding a contenteditable enabled element

Emitter (emojiPickerCaretEmitter)="handleCaretChange($event)"

$event = CaretEvent{ caretOffset: 13, caretRange: Range{...}, textContent: 'content of div or input' }

Emoji Picker will get placed relative the element chosen via the directive api, centered and within window borders

Keywords

FAQs

Last updated on 06 Aug 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc