2.1.0 • Published 3 years ago

@wizdm/emoji v2.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

Emoji Support

Universal emoji support for Angular. The package provides utilities and components rendering emoji as images whenever the native support were missing.

Installation

Import the EmojiSupport module in your root module calling the static init() function to setup the source path for the image files:

import { EmojiSupportModule } from '@wizdm/emoji';

@NgModule({
  imports: [
    ...
    EmojiSupportModule.init( { 
      emojiPath: "https://cdn.jsdelivr.net/npm/emoji-datasource-google@5.0.1/img/google/64/" 
    })
  ]
  bootstrap: [AppComponent]
})
export class AppModule { }

The package is designed to work with images following emoji-datasource naming convention.

Usage Example

The package can be used to both render text or to capture input with emoji:

  <!-- Displays a text with emoji --> 
  <h1 wm-emoji-text="Send a message 😉"></h1>
  
  ...
  
  <!-- Emoji Input within a Material Form -->
  <mat-form-field>
    <mat-label>Emoji Input</mat-label>
    <wm-emoji-input matEmoji [(formControl)]="text" name="text"></wm-emoji-input>
    <mat-hint>Material Form Field applied to universal Emoji Input</mat-hint>
  </mat-form-field>
  
  ...
  

Use the <wm-emoji-text> component to render texts. If native support is available, the component simply renders the text as it is. In case of native support missing, the component renders the text using <img/> elements to render the emoji.

Use the <wm-emoji-input> the same way you'd use a textarea control. The component implements the ControlValueAccessor interface supporting the Angular's form API.

Use the matEmoji directive to enable the component working within a MatFormField.

2.1.0

3 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago