0

During creating my angular2 app I stuck in a point where I have to display facebook posts. I realise login to my application with ngx-facebook library and it is possible to display posts within app.component but when I add another module and I want to use it there it became void (the html appearers in source code but there is no reaction).

I try to place import of this library in my embedded but it doesn't help. I try also to use native javaScript facebook sdk but here I found difficult to provide suitable declaration file.

During my research I came across pages like definitelyTyped, ngx-facebook-sdk sample which I perceive to be potential solutions to my problem but somehow I'm unable to set it properly.

I would appreciate if someone could give a clue how it can be solved or a git where similar problem, and its implementation can be found (maybe someone came across angular 2 app which uses embedded posts and can give a link to git repo)

For summing up I think that problem can be also more generally defined as: 'Using javaScript facebook SDK (or ngx-facebook-sdk) accros angular2 app'

  • Possible duplicate of [FB Like button shows up only once - on first load of my AngularJS view](https://stackoverflow.com/questions/20338619/fb-like-button-shows-up-only-once-on-first-load-of-my-angularjs-view) – CBroe Aug 28 '17 at 09:43
  • @CBroe literal inserting scripts in the code doesn't help. Maybe the problem lie in the way how angular 2 threat the internal scripts or it is connected with asynchronism. – SundayProgrammer Aug 31 '17 at 19:34
  • Sorry, the accepted answer in that question is rather BS. The point is, that you need to call FB.XFBML.parse, to get the code that is added to the document later (after the SDK is initialized) parsed and transformed into social plugins, see https://stackoverflow.com/q/29133563/1427878 – CBroe Sep 01 '17 at 08:07
  • Thanks @CBroe that allows me to display posts :-) But I think that the question might remain open if someone decides to describe way how he/she implements jsFB SDK across angular app. (or maybe declaration of FB variable in chosen component is sufficient) – SundayProgrammer Sep 02 '17 at 07:01

0 Answers0