0

I've added a SHARE button and a LIKE button to my web page. The SHARE button utlises the link to the webpage and the LIKE button is connected to the corresponding Facebook page.

I am using Angularjs and Angular Material. Inside the md-content, it will only display the buttons properly using the iframe code sourced from the Facebook Developers page as opposed to the straight HTML.

I have put the buttons on the home page of the website but there is always a delay in them appearing upon page load (every time the page is displayed). Each button has a separate delay to the other.

I am using an md-whiteframe shadow underneath the buttons to make them more visually appealing, this causes the shadows to render before the buttons.

Is there a way to pre-render the buttons before page load?

I have tried using my Template Service utilising $http.get and the $templateCache, but this results in an error:

No 'Access-Control-Allow-Origin' header is present on the requested resource.

I am also using ui-router and have a preloader service for my ordinary images that are sourced from the app files.

Any help would be greatly appreciated.

J Dawg
  • 525
  • 1
  • 5
  • 14
  • 2
    _“it will only display the buttons properly using the iframe code sourced from the Facebook Developers page as opposed to the straight HTML”_ - in an SPA context, you need to re-parse the document for such social plugins when you dynamically switched out the content … https://stackoverflow.com/a/29134477/1427878 – CBroe Aug 21 '18 at 09:36
  • @CBroe Nice answer. I added it to the dupes list. – georgeawg Aug 21 '18 at 13:20

0 Answers0