angular-easyfb icon indicating copy to clipboard operation
angular-easyfb copied to clipboard

Not rendering like button asynchronously ?

Open heldrida opened this issue 11 years ago • 3 comments

Hi,

First of all thanks a lot for sharing, saved me lot's of time!

I'm using ui-router and resolving if a given user has "liked a page" or not. If not I need to display the facebook like button. The issue I'm finding is that, by returning a promise at the moment it's resolved, the facebook button is not generated but I keep the original html code.

This is my code main.js:

http://pastie.org/private/w4kuxi34qivj7snm729aba

I've got this view to display or not the like button:

http://pastie.org/private/ynjvlqq28zmagbq1p4ymg

I'd really appreciate if someone could have a look :)

Thanks a lot!

heldrida avatar Feb 12 '14 17:02 heldrida

Hi @helderoliveira ,

Thank you for using the module. I'll look into this as soon as I can.

pc035860 avatar Feb 12 '14 18:02 pc035860

Thanks for looking @pc035860 !

I've changed the code a bit, not checking if the user like the page on the .config() ui-router resolve method. But, the fb like button it's still not loading asynchronously. I'm trying to find a fix but didn't found it yet.

http://pastie.org/private/uzv3ugcnjxsvolancfwjxg

heldrida avatar Feb 13 '14 11:02 heldrida

Hello @helderoliveira,

I found that you didn't include ezfb-xfbml directive in your enter_competition.html view. About ezfb-xfbml.

Could you try to wrap the <div class="fb-like"></div> with <div ezfb-xfbml></div>, and see if it works?

I tested it with modified ui-router official example, seems to work fine. http://plnkr.co/edit/UvC8Jf?p=preview

Modifications:

  • Apply ezfb module
  • A like button for /route1, with async resolve
  • No like button for /route2, with async resolve

pc035860 avatar Feb 15 '14 18:02 pc035860