angularfirebase-dynamic-linkssocialshare

Unable to bind a URL property to html page using ngx-sharebuttons


I am receiving a dynamic link from firebase's rest apis.

social.ts

this.shareUrl = res.shortLink; //dynamic link is stored in this  variable from the response.

Now I am trying to provide this.shareUrl(short link) on a social share button used from ngx-sharebuttons.

social.html

<share-buttons class="mb-2 mt-2" [theme]="'circles-dark'" 
[include]="'facebook','twitter','whatsapp']" [show]="9" [url]="'this.shareUrl'">
</share-buttons>

I also tried [url] = "{{this.shareUrl}}"

I want to share this dynamic link across whatsapp, FB ad twitter. I'd appreciate if someone could help me fix this or share an alternative to social share this link.


Solution

  • Remove the quotes or you will be binding a literal string:

    [url]="this.shareUrl"