Iām currently facing an issue with integrating the like box into our ember app, specifically in a template named about
. The problem arises when users enter the ember app from a different route, instead of directly accessing the about
route. In such cases, navigating to the about
route using link-to
helpers prevents the like box from rendering. However, if users directly enter or refresh the about
route, the like box displays correctly. Are there any suggestions on how to ensure the like box renders even when users navigate to that route from another route?
templates/about.hbs:
...
<div class = "fb-like-box" data-href = "https://www.facebook.com/app-link" data-width = "250"
data-height = "313" data-colorscheme = "light" data-show-faces = "true" data-header = "false"
data-stream = "false" data-show-border = "true"></div>
...
views/application.js:
export default Ember.View.extend({
facebook_app_id: config.APP.facebook_app_id,
initLibs: function ()
{
// initialize Facebook SDK
var facebook_id = this.facebook_app_id;
window.fbAsyncInit = function ()
{
FB.init({
appId: facebook_id,
xfbml: true,
version: 'v2.1'
});
};
(function (d, s, id)
{
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id))
{
return;
}
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
}.on('didInsertElement')
});