Comments (5)
In your html:
<emoji-mart (emojiSelect)="addEmoji($event)"></emoji-mart>
And in your component:
public addEmoji(event: {$event: MouseEvent, emoji: EmojiData}) {
let emoticonElement = <HTMLElement> event.$event.target;
if (!emoticonElement.style.backgroundImage || emoticonElement.style.backgroundImage === '') {
emoticonElement = <HTMLElement> emoticonElement.firstChild;
}
console.log(emoticonElement.outerHTML);
// -> will give you the emojis html, which you can use for [innerHTML] etc.
}
Note that you will only need this if you're using some none-angular component or into a contenteditable. Otherwise you can just use <ngx-emoji [emoji]="emojiEventReturnedByPicker.emoji.id"></ngx-emoji>
and then wrap this in a *ngIf or a *ngFor - whatever you need.
from ngx-emoji-mart.
add (emojiClick)="addEmoji($event)" event to your html binding.
and then in your add emoji function.
(HTMLInputElement).value += event.emoji.native
I think it's already listed in the README.md file
from ngx-emoji-mart.
Sorry for bothering, if use emoji native like 😍,
it will show up accordingly to the platform, like iphone showing apple version.
How to apply theme to it, let say if i want to change to twitter version, what should i do?
one more question, is it possible to convert html into
<ngx-emoji=':smiley" size="16"> by regex
and display it using [innerHtml] or sth like that .
Cheers
from ngx-emoji-mart.
innerHTML doesn't render angular components....
from ngx-emoji-mart.
should be easier with the new function added to emoji service https://github.com/TypeCtrl/ngx-emoji-mart#display-emoji-as-custom-element
closing in favor of #89
from ngx-emoji-mart.
Related Issues (20)
- custom searching keyword (i18n)
- Angular Unit Tests failing due to the missing main entry point
- Visual emoji and emoji name mismatch HOT 6
- Switch to jsdelivr cdn - Couldn't find the requested file /img/apple/64/64.png in emoji-datasource-apple. HOT 5
- Many errors after update from ver 7.1.0 to ver 9.x HOT 1
- Update from version 3.1.0 to 6.2.0 cause malformed images on emoji lists HOT 8
- Incognito localStorage access
- Property '"x"' is incompatible with index signature. Type 'x' is not assignable to type 'string'.
- Title not being rendered
- l
- fetching this issu in angular 16.1.6 HOT 3
- Showing the wrong emojis HOT 1
- Angular version 9 is not compatible with 3.1 now HOT 5
- Nagular 9 cant import component ,
- implement in angular 15 and raise issue to import picker component
- Search with native emoji not working like in emoji-mart by missive HOT 2
- Can i implement a complete custom emoji set other then google apple etc? E.g. emojitwo HOT 1
- Some emojis do not display properly HOT 1
- Filtered emojis can also be searched
- Option to hide emoji-mart-anchors
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-emoji-mart.