wdt-emoji-bundle icon indicating copy to clipboard operation
wdt-emoji-bundle copied to clipboard

angularjs integration

Open rkimaoui opened this issue 8 years ago • 24 comments

Hi there,

Thank you for this amazing job. How can in integrate the picker with angularjs application ?

i Hope to see an angular version.

Thanks !

rkimaoui avatar Feb 22 '16 19:02 rkimaoui

+1

chamnap avatar May 09 '16 10:05 chamnap

+1

ghost avatar Jun 02 '16 11:06 ghost

+1

floooat avatar Aug 16 '16 15:08 floooat

+1

SebMenozzi avatar Sep 05 '16 11:09 SebMenozzi

this can be done with a custom directive, I don't think it is within the scope of this library to support a integration into one specific framework

dylanjha avatar Oct 03 '16 17:10 dylanjha

Yes... I created a filter who converts plain text in emoji using emojione.shortnameToImage.

something like this:

app.filter('emojify', function() { return function(input) { return emojione.shortnameToImage(input); } });

and used {{ input | emojify }}.

But... If you have to bind html, i suggest to create a custom directive, and link function will come like this..

link: function(scope, element, attrs){ var template = '<div class="post-content"><div class="post-content-text">'+emojione.shortnameToImage(scope.post.text[0])+'</div></div>'; element.append(template); }

Hope it helps Someone :partly_sunny:

saade avatar Oct 04 '16 01:10 saade

When I import wdt-emoji-bundle.min.js and emoji.min.js (I am using JSPM and es6 style of coding), and then, when I use wdtEmojiBundle.init, I get error "wdtEmojiBundle is not defined"

SamarRizvi avatar Dec 01 '16 08:12 SamarRizvi

@Samar that is obvious, since wdtEmojiBundle is not imported. You've to find a way whereby you get access to all the methods inside wdtEmojiBundle object. In angular style for web, I would directly use it as $scope.wdtEmojiBundle.

nageshd3 avatar Dec 01 '16 09:12 nageshd3

@nageshd3 I am using controller as methodology and I have used this.wdtEmojiBundle but still same error.

SamarRizvi avatar Dec 01 '16 11:12 SamarRizvi

@SamarRizvi if you are using angular 2 with typescript:

you need to declare wdtEmojiBundle with

declare var wdtEmojiBundle:any;

saade avatar Dec 01 '16 19:12 saade

@nageshd3 @SamarRizvi

I am having the same issue as @nageshd3 and I am using angular1. I'm trying to get the emoji picker to display inside of an input field that's found within an html template associated with a controller. When I try to init this bundle in the controller (by way of a simple this.wdtEmojiBundle.init() in the controller, I get the same error that @nageshd3 had.

As others have suggested, it seems this is not meant to be used within an angular app.

Exponent500 avatar Dec 08 '16 21:12 Exponent500

Hi, I'm having some issue, I'm trying to install for angular 2 & typescript, but I don't understand how to implement this :disappointed: someone can help me please ?

LeiwenL avatar Jan 27 '17 15:01 LeiwenL

Same issue here .. ! I can't integrate

rajkuttie avatar Jun 05 '17 11:06 rajkuttie

My issue is when i want to execute wdtEmojibundle.init(''.my-input-selector") it tells me it's not a constructor :/ And I'm not sure where exactly i could be wrong? Did someone also had the same issue?

Tikoriya avatar Jul 27 '17 11:07 Tikoriya

@VLazzarova Can you try with capital letter of B: wdtEmojiBundle.init

needim avatar Jul 27 '17 11:07 needim

@needim It's actually how I wrote it, wrote it with a typo inhere 🙈 So after i add the scripts and i call my function.. do i have to initialize the ** wdtEmojiBundle** Object somewhere else?

Tikoriya avatar Jul 27 '17 11:07 Tikoriya

@VLazzarova Oh this is an issue about Angular :/ I'm not familiar with Angular :/

needim avatar Jul 27 '17 11:07 needim

@needim I found sth. I think it throws me the error cause of the EmojiConvertor. In the init function it calls this constructor, so it throws me the error it's not a constructor. It actually prints the EmojiConvertor on the console as _ (and my error is exactly: " _ is not a constructor") Some thoughts on that may be?

Tikoriya avatar Jul 27 '17 11:07 Tikoriya

@VLazzarova hmm emoji.min.js is a dependency. It's in the repo. Maybe you missed that part?

needim avatar Jul 27 '17 11:07 needim

@VLazzarova check the file emoji.min.js is being loaded when you initialize controller. If you are lazy loading, try to load this library file serially.

nageshd3 avatar Jul 27 '17 13:07 nageshd3

@needim yep, that was it! I was loading wdt-emoji-bundle.min.js first and then the emoji.min.js Thank you for the help ! 🙌🏼

Tikoriya avatar Jul 28 '17 13:07 Tikoriya

@VLazzarova nice! I guess I'm not good at documentation section, I will work on that. :/

needim avatar Jul 28 '17 15:07 needim

@needim a getting this error what do you think could be the problem..? Uncaught TypeError: Cannot read property 'querySelector' of null at Object.h.init (wdt-emoji-bundle.min.js:16) at

topseySuave avatar Aug 23 '17 12:08 topseySuave

If anyone has been able to make an integration with AngularJS work for the emoji picker, please do share the code/repo.

adeopura4 avatar Oct 25 '19 05:10 adeopura4