UNPKG

angular-news-api

Version:

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.

2 lines 1.37 kB
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("newsapi"),require("rxjs"),require("@angular/core")):"function"==typeof define&&define.amd?define("angular-news-api",["exports","newsapi","rxjs","@angular/core"],n):n(e["angular-news-api"]={},e.NewsAPI,e.rxjs,e.ng.core)}(this,function(e,n,r,t){"use strict";n=n&&n.hasOwnProperty("default")?n["default"]:n;var o=new t.InjectionToken("NewsApiConfig"),i=function(){function e(e){this.newsApiConfigService=e,this.newsApi=new n(this.newsApiConfigService.key)}return e.prototype.topHeadlines=function(e){return r.from(this.newsApi.v2.topHeadlines(e))},e.prototype.everything=function(e){return r.from(this.newsApi.v2.everything(e))},e.prototype.sources=function(e){return r.from(this.newsApi.v2.sources(e))},e.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:undefined,decorators:[{type:t.Inject,args:[o]}]}]},e.ngInjectableDef=t.defineInjectable({factory:function(){return new e(t.inject(o))},token:e,providedIn:"root"}),e}(),s=function(){function n(){}return n.forRoot=function(e){return{ngModule:n,providers:[i,{provide:o,useValue:e}]}},n.decorators=[{type:t.NgModule,args:[{}]}],n}();e.NewsApiService=i,e.NgnewsModule=s,e.ɵa=o,Object.defineProperty(e,"__esModule",{value:!0})}); //# sourceMappingURL=angular-news-api.umd.min.js.map