GitXplorerGitXplorer
A

ng2-emoji

public
26 stars
10 forks
3 issues

Commits

List of commits on branch master.
Verified
008d902edd36d4cde762246fe7244a1e12d3af5a

Merge pull request #7 from AhsanAyaz/update-readme-and-ci

AAhsanAyaz committed 7 years ago
Unverified
4eb8d8eea6666dd5110baff2c0956a9cb2f7902a

chore(ci): removed ng test because there are no unit tests at the moment

AAhsanAyaz committed 7 years ago
Unverified
5663aa3cae1174253576929439290e47263a2996

fix(ci): added npm install & fixed the build step

AAhsanAyaz committed 7 years ago
Unverified
81521607ade8acc80c69525f360ac667ca3a81c0

chore(ci): updated CI & added a test

AAhsanAyaz committed 7 years ago
Verified
d43139a4026dcc10df5e5e53d275c46282468bf5

Merge pull request #6 from jcjc712/master

AAhsanAyaz committed 7 years ago
Unverified
30f94c666ee3f824641ed7b21c072e7cf05ffd60

feat(example) create project for examples

committed 7 years ago

README

The README file for this repository.

ng2-emoji

image

Installation

To install this library, run:

$ npm install ng2-emoji --save

Demo Example

See the live example (Angular4 project) here

Usage

VERY IMPORTANT In one of your css/scss files. include these styles:

.emoji{
    display:inline-block;
}

In your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

// Import your library
import { Ng2EmojiModule } from 'ng2-emoji';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,

    // Include the awesome
    Ng2EmojiModule.forRoot()
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

In your index.html:

<link href="./node_modules/ng2-emoji/css/ng2-emoji.css" rel="stylesheet">

OR if using angular-cli.json, use:

 "apps": [
    {
      ...
      "styles": [
        "styles.css",
        "../node_modules/ng2-emoji/css/ng2-emoji.css"
      ],
      ...
  ]

In your component where you want to use ng2-emoji, just use:

 <div class="message-container" [innerHTML]="myMessageString | emojis">
 </div>

where the model myMessageString inside your @Component will be:

...
export class MyComponent {
    public messageString: String = "";
    constructor() {
        this.myMessageString = 'Hello, how are you? :smile: It was fun at the bowling game the other day :joy:';
    }
}

Development

Clone the repository:

git clone https://github.com/AhsanAyaz/ng2-emoji

Install dependencies

npm install

To build the library:

npm run build

To generate the spritesheet :

gulp sprite

To lint all *.ts files:

npm run lint

Run example locally

Perform the following steps to serve the Angular example locally. Navigate to http://localhost:4200 after that.

cd example
npm install
ng serve

Contribution

Feel free to contribute to this repo by:

  • Adding Examples
  • Resolving open issues

Thanks to Juan Carlos for the amazing Angular example

License

MIT © Ahsan Ayaz