Mercurial > hg > ng2-query-ismi
view src/app/normalization.service.js @ 58:3b4046e0cc02 default
Merge from ng2-table branch.
d7c947909ab888c013171b8c037e4f9fab30fe57
author | casties |
---|---|
date | Wed, 29 Mar 2017 17:19:12 +0200 |
parents | |
children |
line wrap: on
line source
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var core_1 = require('@angular/core'); var http_1 = require('@angular/http'); require('rxjs/Rx'); // import all RxJS operators var app_config_1 = require('./app-config'); var NormalizationService = (function () { function NormalizationService(_http) { this._http = _http; } NormalizationService.prototype.fetchArabicTranslitNormalizedString = function (text) { console.debug("fetching arabic translit normalized string: ", text); var headers = new http_1.Headers(); headers.append('Accept', 'application/json'); // put headers in options var opts = { 'headers': headers }; // make get request asynchronously var url = app_config_1.OPENMIND_BASE_URL + 'jsonInterface?method=normalize_string&type=arabic_translit&text='; url += encodeURIComponent(text); var resp = this._http.get(url, opts) .map(function (res) { return res.json(); }); // return Observable return resp; }; NormalizationService = __decorate([ core_1.Injectable(), __metadata('design:paramtypes', [http_1.Http]) ], NormalizationService); return NormalizationService; }()); exports.NormalizationService = NormalizationService; //# sourceMappingURL=normalization.service.js.map