Skip to content

Instantly share code, notes, and snippets.

@lentschi
Last active May 1, 2020 10:35
Show Gist options
  • Save lentschi/8600f9b6ea7e7f5178f40a36f3053de7 to your computer and use it in GitHub Desktop.
Save lentschi/8600f9b6ea7e7f5178f40a36f3053de7 to your computer and use it in GitHub Desktop.
Angular 2+ pipe to replace emoji-mart emojis with an html element displaying their image representation
@asdrubalivan
Copy link

asdrubalivan commented Apr 2, 2020

Hello, I'm getting the following

Argument of type '(set: string, sheetSize: number) => string' is not assignable to parameter of type 'number'

Any help? I'm using version 3.0.3 of emoji mart. They added a new param called sheetRows which is a number in here

                    const styles = this.emojiService.emojiSpriteStyles(
                        matchingData.sheet,
                        set,
                        size,
                        sheetSize,
                        backgroundImageFn
                    );

Just between sheetSize and backgroundImageFn

@lentschi
Copy link
Author

lentschi commented Apr 5, 2020

@asdrubalivan I haven't had time to try this out yet, but the new sheetRows parameter is optional - could you not just replace it with undefined and it would still work?

@lentschi
Copy link
Author

lentschi commented Apr 13, 2020

@asdrubalivan I fixed it, but not in the Gist: Due to the ongoing popularity of this Gist, I decided to turn it into a library after all:
npmjs.com: https://www.npmjs.com/package/ng-utf8-emojis-to-images
GitHub: https://github.com/lentschi/ng-utf8-emojis-to-images

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment