Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@zomoz/ngx-share
Advanced tools
Convert any element to a share button using [shareButton]
directive.
Install with npm
$ npm install --save @ngx-share/core
Import ShareModule
in your module
import { ShareModule } from '@ngx-share/core';
@NgModule({
imports: [
HttpClientModule, // (Required) for share counts
HttpClientJsonpModule, // (Optional) For linkedIn & Tumblr counts
ShareModule.forRoot()
]
})
In your template
<button shareButton="facebook">Share</button>
<button shareButton="twitter">Tweet</button>
<button shareButton="pinterest">Pin</button>
To use the default icons or colors, use ShareButtons service so you can access buttons properties
import { ShareButtons } from '@ngx-share/core';
@Component({
// ...
})
export class MyComponent {
constructor(public share: ShareButtons) {
}
}
Now you can set them
<!--Set color and icon-->
<button shareButton="twitter" [style.backgroundColor]="share.prop.twitter.color">
<i [class]="share.prop.twitter.icon"></i>
</button>
<!--Material example-->
<button md-icon-button shareButton="telegram" [style.color]="share.prop.telegram.color">
<i [class]="share.prop.telegram.icon"></i>
</button>
Check ShareButton Directive Demo
Name | Default value | Description |
---|---|---|
[shareButton] | null | Button name, e.g. 'facebook', 'twitter' ...etc. |
[sbUrl] | current URL | Sharing link. |
[sbTitle] | null | Override title meta tag for LinkedIn and Reddit. |
[sbDescription] | null | Override description meta tag for LinkedIn, WhatsApp, Telegram and Pinterest |
[sbImage] | null | Override image meta tag for Pinterest only. |
[sbTags] | null | Override tags for Tumblr and Twitter. |
(sbOpened) | button name | Stream that emits when share window has opened. |
(sbClosed) | button name | Stream that emits when share dialog has closed. |
(sbCount) | share count | Stream that emits share count of the share URL. |
If you identify any errors in this component, or have an idea for an improvement, please open an issue. I am excited to see what the community thinks of this project, and I would love your input!
Murhaf Sousli
FAQs
Share buttons components for Angular and Ionic.
We found that @zomoz/ngx-share demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.