Embed (twitter & facebook post)


Hi, i´m develop a news app, i´m traying to embed facebook and twitter posts using de respectives iframe API but for de CROSS ORIGIN IFRAME i can´t access to the ifram content height, so embed elements with largest content appears hidden.

In onload event of the iframe i try to acces of child height

@ViewChild(‘iframe’) iframeElement: ElementRef;
onLoad(event) {
var contectiFrame = this.iframeElement.nativeElement.contentDocument.querySelector(‘body’);
this.heightElement = contectiFrame.offsetHeight

Before i decide use iframes i try to use oficial scripsts for enbed, but didn´t work neither

Any idea ?


I’m trying this same thing using ngx-facebook with no success.

@migueloruiz, any progress with this?