0

I am working around a Facebook sdk and angularJS. I have a trouble about how to dynamic loading Facebook Embed post in Angular Template.

after request Ajax success it doesn't show anything

<div class="fb-post" data-href="{{EmbedPostUrl}}" data-width="500"></div>

Any idea ?

1 Answers1

0

The Problem could be that the Expression in data-href will be resolved immediately to {{EmbedPostUrl}} which will trigger an 404 Error. Try to write a custom directive which will create the data-href attribut if the passed value is not false.

If that doesnt works, try to load the facebook sdk asynchronous after the ajax call was done.

And if you need to change the url sometimes, try to create the whole element by yourself wit a custom directive.

Nano
  • 1,398
  • 6
  • 20
  • 32