angular-kladr
Version:
Angular 4+ package for better experience using kladr api service
2 lines • 2.28 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/platform-browser"),require("@angular/common/http"),require("@angular/http"),require("rxjs/operators"),require("@angular/core")):"function"==typeof define&&define.amd?define("angular-kladr",["exports","@angular/common","@angular/platform-browser","@angular/common/http","@angular/http","rxjs/operators","@angular/core"],t):t(e["angular-kladr"]={},e.ng.common,e.ng.platformBrowser,e.ng.common.http,e.ng.http,e.rxjs.operators,e.ng.core)}(this,function(e,r,o,n,i,s,a){"use strict";var t={"with":1,without:0};t[t["with"]]="with",t[t.without]="without";var u={cities:1,townships:2,villages:4};u[u.cities]="cities",u[u.townships]="townships",u[u.villages]="villages";var l={"true":1,"false":0};l[l["true"]]="true",l[l["false"]]="false";function p(){this.isSecure=!1}var c=new a.InjectionToken("KLADR_OPTIONS"),d=function(){function e(e,t){this.jsonp=e,this.options=t,this.baseUrl="kladr-api.ru/api.php",this.HTTP="http://",this.HTTPS="https://",this.url=t.isSecure?this.HTTPS+this.baseUrl:this.HTTP+this.baseUrl}return e.prototype.api=function(t){var r=this.url+"?";return Object.keys(t).forEach(function(e){r+=e+"="+t[e]+"&"}),r+="callback=JSONP_CALLBACK",this.jsonp.request(r).pipe(s.map(function(e){return e.json()||e.json()}))},e.decorators=[{type:a.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:i.Jsonp},{type:p,decorators:[{type:a.Inject,args:[c]}]}]},e.ngInjectableDef=a.defineInjectable({factory:function(){return new e(a.inject(i.Jsonp),a.inject(c))},token:e,providedIn:"root"}),e}(),f=function(){function t(){}return t.forRoot=function(e){return void 0===e&&(e=undefined),{providers:[{provide:c,useValue:e}],ngModule:t}},t.decorators=[{type:a.NgModule,args:[{declarations:[],imports:[r.CommonModule,o.BrowserModule,i.JsonpModule,n.HttpClientJsonpModule,n.HttpClientModule],providers:[d]}]}],t}();e.KladrContentType={region:"region",district:"district",city:"city",street:"street",building:"building"},e.KladrWithParent=t,e.KladrCodeType=u,e.KladrOneString=l,e.KladrModule=f,e.KladrService=d,e.Options=p,e.KLADR_OPTIONS=c,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=angular-kladr.umd.min.js.map