Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
ng-social-links
Advanced tools
Headless social share for Angular. Provides straightforward API for getting social share URLs which can be used in your templates.
ng-social-links advantages:
Install package
npm i ng-social-links
Add import to your module
import { NgSocialLinksModule } from 'ng-social-links';
@NgModule({
imports: [
...
NgSocialLinksModule.forRoot(),
],
declarations: [],
providers: []
})
Inject the service:
import { NgSocialLinksService } from 'ng-social-links';
class SomeComponent {
constructor(private socialLinks: NgSocialLinksService) {}
}
Get the socail share links:
facebookShareLink = this.socialLinks.getShareLink('fa');
With additional parameters:
twitterShareLink = this.socialLinks.getShareLink('tw', { title: 'Visit my website!' });
The configuration interface looks like this:
interface Config {
url?: string;
title?: string;
description?: string;
}
By default document.location.href
is used for url
, title
and description
are empty.
You can define another defaults as follows:
NgSocialLinksModule.forRoot({ url: 'htts://my-website.com' })
Or
NgSocialLinksModule.forRoot({ title: 'Visit my website!', description: 'Default email body...' })
ng-social-links is headless, so you're free to use whatever you like in a template. e.g. text links, icons, buttons, you name it. For example:
<a [attr.href]="facebookShareLink">
<fa-icon [icon]="faFacebook"></fa-icon>
</a>
Another option is to create a popup window:
const telegramLink = facebookShareLink = this.socialLinks.getShareLink('tg');
window.open(telegramLink,'SocialSharePopup','width=600,height=600');
Currently, demo is only available on localhost:
npm install
.npm start
.You are more than welcome to improve this library (for example, add missing social share providers) or create issues on the GitHub issue tracker.
FAQs
Headless social share for Angular
We found that ng-social-links 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.