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
====================
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