Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concern of using class restriction for social plugin directive #48

Open
NenadP opened this issue Jul 3, 2015 · 1 comment
Open

Concern of using class restriction for social plugin directive #48

NenadP opened this issue Jul 3, 2015 · 1 comment

Comments

@NenadP
Copy link

NenadP commented Jul 3, 2015

Any particular reason why is possible to use the directive via class? I see in the source that it is either element or class.

My concern is that there is significant number of class names that the directive reserves and could easily collide unintentionally.

@pc035860
Copy link
Owner

pc035860 commented Jul 4, 2015

Hi @NenadP ,

I was hoping to achieve the "seamless" integration with Facebook's social plugins. The "seamless" means that I can just get code from https://developers.facebook.com/docs/plugins/like-button, and it's ready to render.

I understand your concern, but the thing is that Facebook JS SDK actually makes an full page social plugin render call on initialization.

And HTML code like

<div class="fb-like" data-href="https://developers.facebook.com/docs/plugins/" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>

gets rendered into social plugins even if angular-easyfb doesn't handle it.

One way to resolve the issue is canceling the "seamless" integration, by changing the directive restrict to 'EA' and prefix the directive name with ez maybe.

<div ezfb-like data-href="https://developers.facebook.com/docs/plugins/" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>

The original "seamless" idea comes from that XFBML.parse requires social-plugins's class name specified to get parsed, which means you have to add class="fb-like" on it. But as the implement goes on, I figured out some hacky way to deal with it, so it's no longer a limitation anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants