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.
angular-news-api
Advanced tools
This Library provides everything you need to use the NewsAPI from you Angular app the way it should be: using Observables, Types and Dependency Injection.
This Library provides everything you need to use the NewsAPI from you Angular app the way it should be: using Observables, Types and Dependency Injection.
npm install --save angular-news-api
Import the AppRoutingModule
into your app module and configure your API Key:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { NgnewsModule } from 'angular-news-api';
import { NewsApiKeyConfig } from 'angular-news-api';
const newsApiConfig: NewsApiKeyConfig = {
key: 'API_KEY_FROM_NEWS_API'
};
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
NgnewsModule.forRoot(newsApiConfig)
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Now you can use all the endpoints of the API:
constructor(private newsApiService: NewsApiService) {}
topHeadlines() {
this.newsApiService.topHeadlines({
sources: 'bbc-news,the-verge'
}).subscribe(data => console.log(data));
}
everything() {
this.newsApiService.everything({
q: 'trump'
}).subscribe(data => console.log(data));
}
sources() {
this.newsApiService.sources({
country: 'us'
}).subscribe(data => console.log(data));
}
Check the official documentation for more info about the options in each endpoint.
FAQs
This Library provides everything you need to use the NewsAPI from you Angular app the way it should be: using Observables, Types and Dependency Injection.
We found that angular-news-api 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.