how to showing plugin comment fb on angular js?
NickName:monoy suronoy Ask DateTime:2016-03-05T13:29:36

how to showing plugin comment fb on angular js?

i'm new on angular, and i have some problem to showing plugin comment fb on my angular web app.

i following this tutorial : jsfiddle

example code :

// preview.directive.js :

'use strict';

window.FB = {
    XFBML: {
        parse: function (elem) {
            var pre = document.createElement('pre');
            pre.textContent = elem.innerHTML;
            document.getElementById('fb-comment-box').innerHTML =
                    pre.outerHTML;
        }
    }
};

angular.module('kulinerLezatkuApp')
  .directive('myFbCommentBox', function () {
    function createHTML(href, numposts, colorscheme) {
        return '<div class="fb-comments" ' +
                       'data-href="' + href + '" ' +
                       'data-numposts="' + numposts + '" ' +
                       'data-colorsheme="' + colorscheme + '">' +
               '</div>';
    }

    return {
        restrict: 'A',
        scope: {},
        link: function postLink(scope, elem, attrs) {
            attrs.$observe('pageHref', function (newValue) {
                var href        = newValue;
                var numposts    = attrs.numposts    || 5;
                var colorscheme = attrs.colorscheme || 'light';

                elem.html(createHTML(href, numposts, colorscheme));
                FB.XFBML.parse(elem[0]);
            });
        }
    };
});

// preview.html
<div id="fb-comment-box" my-fb-comment-box=""
            page-href="http://localhost:9000/items/{{main.myParams._id}}/preview"
            numposts="5"
            colorsheme="light">

but on my page just showing text, and not html...i need help thanks

====================

Solved with easyfb

Copyright Notice:Content Author:「monoy suronoy」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/35810464/how-to-showing-plugin-comment-fb-on-angular-js

More about “how to showing plugin comment fb on angular js?” related questions

how to showing plugin comment fb on angular js?

i'm new on angular, and i have some problem to showing plugin comment fb on my angular web app. i following this tutorial : jsfiddle example code : // preview.directive.js : 'use strict'; wind...

Show Detail

Comment not appearing in Comments plugin

Having some trouble getting the link back to the page from a posted FB Comment plugin to work. Here is my situation: Setup Comments plugin using HTML5 code snippet provided by FB. Page renders

Show Detail

FB comment plugin: User Notifications

Users on my website can create their own content pages and I want to enable FB comment plugin on those pages. As a moderator of the FB app, I get the notifications but is there a way the user who c...

Show Detail

facebook comment plugin with angular 8

I am trying to integrate the facebook comment plugin with my angular app. I am using the latest version of API. I put &lt;div id="fb-root"&gt;&lt;/div&gt; &lt;script async defer crossorigin="anon...

Show Detail

Facebook comment plugin in Hybrid mobile app not showing

I am using this plugin on my website. This will enable people to write their comment on fb comment box. This link will give you the comment plugin code: https://developers.facebook.com/docs/plugins/

Show Detail

Add blacklist to facebook fb:comment plugin without relating to a app_id

I want to add a blacklist to my fb:comment plugin, I have it on my website, but facebook docs only show me how to add the blacklist for an app using the moderation dashboard. I do not have an app_i...

Show Detail

facebook comment plugin disappeared

I had the comment plugin working fine, along with the like button and then they stopped working. I don't believe anything was changed they just stopped showing up. I switched the like button to the

Show Detail

Facebook comment box plugin

I am using Facebook comment box plugin: &lt;fb:comments href="${myPageUrl}" num_posts="20" width="630"&gt;&lt;/fb:comments&gt; Every thing is working fine. The problem is that I want to store

Show Detail

Facebook comment box plugin

I am using Facebook comment box plugin: &lt;fb:comments href="${myPageUrl}" num_posts="20" width="630"&gt;&lt;/fb:comments&gt; Every thing is working fine. The problem is that I want to store

Show Detail

Facebook Comment Count on Comments Plugin

I run many news sites which use the Facebook comments plugin, e.g. &lt;script&gt; (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return...

Show Detail