Angular social sharing is easier that you think.
ngx-socilal-share - simple directive for sharing your pages via facebook, linkedin and other
Install package
npm i ngx-social-share
Add import to your module
import { NgxSocialShareModule } from 'ngx-social-share';
@NgModule({
imports: [
...
NgxSocialShareModule,
],
declarations: [],
providers: []
})
Add [socialShare]="label_here"
to any of your elements or components
<div>
<div [socialShare]="'fb'">Facebook</div>
<div [socialShare]="'tw'">Twitter</div>
<div [socialShare]="'in'">Linkdedin</div>
<div [socialShare]="'tr'">Tumblr</div>
<div [socialShare]="'rd'">Reddit</div>
<div [socialShare]="'pn'">Pinterest</div>
<div [socialShare]="'dg'">Share via Digg</div>
</div>
On click this element will share current opened
page to social
- 'fb' - Facebook
- 'tw' - Twitter
- 'in' - LinkedIn
- 'tr' - Tumblr
- 'dg' - Digg
- 'rd' - Reddit
- 'pn' - Pinterest