repackaging: all the repackaging changes squashed
This commit is contained in:
@ -4,36 +4,36 @@
|
||||
* The http module provides services to perform http requests. To get started, see the {@link Http}
|
||||
* class.
|
||||
*/
|
||||
import {provide, Provider} from 'angular2/core';
|
||||
import {Http, Jsonp} from './src/http/http';
|
||||
import {XHRBackend, XHRConnection} from './src/http/backends/xhr_backend';
|
||||
import {JSONPBackend, JSONPBackend_, JSONPConnection} from './src/http/backends/jsonp_backend';
|
||||
import {BrowserXhr} from './src/http/backends/browser_xhr';
|
||||
import {BrowserJsonp} from './src/http/backends/browser_jsonp';
|
||||
import {BaseRequestOptions, RequestOptions} from './src/http/base_request_options';
|
||||
import {ConnectionBackend} from './src/http/interfaces';
|
||||
import {BaseResponseOptions, ResponseOptions} from './src/http/base_response_options';
|
||||
export {Request} from './src/http/static_request';
|
||||
export {Response} from './src/http/static_response';
|
||||
import {provide} from '@angular/core';
|
||||
import {Http, Jsonp} from './src/http';
|
||||
import {XHRBackend, XHRConnection} from './src/backends/xhr_backend';
|
||||
import {JSONPBackend, JSONPBackend_, JSONPConnection} from './src/backends/jsonp_backend';
|
||||
import {BrowserXhr} from './src/backends/browser_xhr';
|
||||
import {BrowserJsonp} from './src/backends/browser_jsonp';
|
||||
import {BaseRequestOptions, RequestOptions} from './src/base_request_options';
|
||||
import {ConnectionBackend} from './src/interfaces';
|
||||
import {BaseResponseOptions, ResponseOptions} from './src/base_response_options';
|
||||
export {Request} from './src/static_request';
|
||||
export {Response} from './src/static_response';
|
||||
|
||||
export {
|
||||
RequestOptionsArgs,
|
||||
ResponseOptionsArgs,
|
||||
Connection,
|
||||
ConnectionBackend
|
||||
} from './src/http/interfaces';
|
||||
} from './src/interfaces';
|
||||
|
||||
export {BrowserXhr} from './src/http/backends/browser_xhr';
|
||||
export {BaseRequestOptions, RequestOptions} from './src/http/base_request_options';
|
||||
export {BaseResponseOptions, ResponseOptions} from './src/http/base_response_options';
|
||||
export {XHRBackend, XHRConnection} from './src/http/backends/xhr_backend';
|
||||
export {JSONPBackend, JSONPConnection} from './src/http/backends/jsonp_backend';
|
||||
export {Http, Jsonp} from './src/http/http';
|
||||
export {BrowserXhr} from './src/backends/browser_xhr';
|
||||
export {BaseRequestOptions, RequestOptions} from './src/base_request_options';
|
||||
export {BaseResponseOptions, ResponseOptions} from './src/base_response_options';
|
||||
export {XHRBackend, XHRConnection} from './src/backends/xhr_backend';
|
||||
export {JSONPBackend, JSONPConnection} from './src/backends/jsonp_backend';
|
||||
export {Http, Jsonp} from './src/http';
|
||||
|
||||
export {Headers} from './src/http/headers';
|
||||
export {Headers} from './src/headers';
|
||||
|
||||
export {ResponseType, ReadyState, RequestMethod} from './src/http/enums';
|
||||
export {URLSearchParams} from './src/http/url_search_params';
|
||||
export {ResponseType, ReadyState, RequestMethod} from './src/enums';
|
||||
export {URLSearchParams} from './src/url_search_params';
|
||||
|
||||
/**
|
||||
* Provides a basic set of injectables to use the {@link Http} service in any application.
|
||||
@ -44,10 +44,10 @@ export {URLSearchParams} from './src/http/url_search_params';
|
||||
* ### Example ([live demo](http://plnkr.co/edit/snj7Nv?p=preview))
|
||||
*
|
||||
* ```
|
||||
* import {Component} from 'angular2/core';
|
||||
* import {bootstrap} from 'angular2/platform/browser';
|
||||
* import {NgFor} from 'angular2/common';
|
||||
* import {HTTP_PROVIDERS, Http} from 'angular2/http';
|
||||
* import {Component} from '@angular/core';
|
||||
* import {bootstrap} from '@angular/platform-browser/browser';
|
||||
* import {NgFor} from '@angular/common';
|
||||
* import {HTTP_PROVIDERS, Http} from '@angular/http';
|
||||
*
|
||||
* @Component({
|
||||
* selector: 'app',
|
||||
@ -100,9 +100,9 @@ export {URLSearchParams} from './src/http/url_search_params';
|
||||
* ### Example ([live demo](http://plnkr.co/edit/aCMEXi?p=preview))
|
||||
*
|
||||
* ```
|
||||
* import {provide} from 'angular2/core';
|
||||
* import {bootstrap} from 'angular2/platform/browser';
|
||||
* import {HTTP_PROVIDERS, BaseRequestOptions, RequestOptions} from 'angular2/http';
|
||||
* import {provide} from '@angular/core';
|
||||
* import {bootstrap} from '@angular/platform-browser/browser';
|
||||
* import {HTTP_PROVIDERS, BaseRequestOptions, RequestOptions} from '@angular/http';
|
||||
*
|
||||
* class MyOptions extends BaseRequestOptions {
|
||||
* search: string = 'coreTeam=true';
|
||||
@ -118,10 +118,10 @@ export {URLSearchParams} from './src/http/url_search_params';
|
||||
* ### Example ([live demo](http://plnkr.co/edit/7LWALD?p=preview))
|
||||
*
|
||||
* ```
|
||||
* import {provide} from 'angular2/core';
|
||||
* import {bootstrap} from 'angular2/platform/browser';
|
||||
* import {HTTP_PROVIDERS, Http, Response, XHRBackend} from 'angular2/http';
|
||||
* import {MockBackend} from 'angular2/http/testing';
|
||||
* import {provide} from '@angular/core';
|
||||
* import {bootstrap} from '@angular/platform-browser/browser';
|
||||
* import {HTTP_PROVIDERS, Http, Response, XHRBackend} from '@angular/http';
|
||||
* import {MockBackend} from '@angular/http/testing';
|
||||
*
|
||||
* var people = [{name: 'Jeff'}, {name: 'Tobias'}];
|
||||
*
|
||||
@ -183,9 +183,9 @@ export const HTTP_BINDINGS = HTTP_PROVIDERS;
|
||||
* ### Example ([live demo](http://plnkr.co/edit/vmeN4F?p=preview))
|
||||
*
|
||||
* ```
|
||||
* import {Component} from 'angular2/core';
|
||||
* import {NgFor} from 'angular2/common';
|
||||
* import {JSONP_PROVIDERS, Jsonp} from 'angular2/http';
|
||||
* import {Component} from '@angular/core';
|
||||
* import {NgFor} from '@angular/common';
|
||||
* import {JSONP_PROVIDERS, Jsonp} from '@angular/http';
|
||||
*
|
||||
* @Component({
|
||||
* selector: 'app',
|
||||
@ -231,9 +231,9 @@ export const HTTP_BINDINGS = HTTP_PROVIDERS;
|
||||
* ### Example ([live demo](http://plnkr.co/edit/TFug7x?p=preview))
|
||||
*
|
||||
* ```
|
||||
* import {provide} from 'angular2/core';
|
||||
* import {bootstrap} from 'angular2/platform/browser';
|
||||
* import {JSONP_PROVIDERS, BaseRequestOptions, RequestOptions} from 'angular2/http';
|
||||
* import {provide} from '@angular/core';
|
||||
* import {bootstrap} from '@angular/platform-browser/browser';
|
||||
* import {JSONP_PROVIDERS, BaseRequestOptions, RequestOptions} from '@angular/http';
|
||||
*
|
||||
* class MyOptions extends BaseRequestOptions {
|
||||
* search: string = 'coreTeam=true';
|
||||
@ -249,9 +249,9 @@ export const HTTP_BINDINGS = HTTP_PROVIDERS;
|
||||
* ### Example ([live demo](http://plnkr.co/edit/HDqZWL?p=preview))
|
||||
*
|
||||
* ```
|
||||
* import {provide, Injector} from 'angular2/core';
|
||||
* import {JSONP_PROVIDERS, Jsonp, Response, JSONPBackend} from 'angular2/http';
|
||||
* import {MockBackend} from 'angular2/http/testing';
|
||||
* import {provide, Injector} from '@angular/core';
|
||||
* import {JSONP_PROVIDERS, Jsonp, Response, JSONPBackend} from '@angular/http';
|
||||
* import {MockBackend} from '@angular/http/testing';
|
||||
*
|
||||
* var people = [{name: 'Jeff'}, {name: 'Tobias'}];
|
||||
* var injector = Injector.resolveAndCreate([
|
||||
|
1
modules/@angular/http/index.ts
Normal file
1
modules/@angular/http/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './http';
|
14
modules/@angular/http/package.json
Normal file
14
modules/@angular/http/package.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "@angular/http",
|
||||
"version": "$$ANGULAR_VERSION$$",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"jsnext:main": "esm/index.js",
|
||||
"typings": "index.d.ts",
|
||||
"author": "angular",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"rxjs": "5.0.0-beta.6",
|
||||
"@angular/core": "$$ANGULAR_VERSION$$"
|
||||
}
|
||||
}
|
20
modules/@angular/http/rollup.config.js
Normal file
20
modules/@angular/http/rollup.config.js
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
export default {
|
||||
entry: '../../../dist/packages-dist/http/esm/index.js',
|
||||
dest: '../../../dist/packages-dist/http/esm/http.umd.js',
|
||||
sourceMap: true,
|
||||
format: 'umd',
|
||||
moduleName: 'ng.http',
|
||||
globals: {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/compiler': 'ng.compiler',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
'rxjs/Subject': 'Rx',
|
||||
'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update.
|
||||
'rxjs/operator/toPromise': 'Rx.Observable.prototype',
|
||||
'rxjs/Observable': 'Rx'
|
||||
},
|
||||
plugins: [
|
||||
// nodeResolve({ jsnext: true, main: true }),
|
||||
]
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import {Injectable} from 'angular2/core';
|
||||
import {global} from 'angular2/src/facade/lang';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {global} from '../../src/facade/lang';
|
||||
|
||||
let _nextRequestId = 0;
|
||||
export const JSONP_HOME = '__ng_jsonp__';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {Injectable} from 'angular2/core';
|
||||
import {Injectable} from '@angular/core';
|
||||
|
||||
/**
|
||||
* A backend for http that uses the `XMLHttpRequest` browser API.
|
||||
|
@ -3,10 +3,10 @@ import {ReadyState, RequestMethod, ResponseType} from '../enums';
|
||||
import {Request} from '../static_request';
|
||||
import {Response} from '../static_response';
|
||||
import {ResponseOptions, BaseResponseOptions} from '../base_response_options';
|
||||
import {Injectable} from 'angular2/core';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {BrowserJsonp} from './browser_jsonp';
|
||||
import {makeTypeError} from 'angular2/src/facade/exceptions';
|
||||
import {StringWrapper, isPresent} from 'angular2/src/facade/lang';
|
||||
import {makeTypeError} from '../../src/facade/exceptions';
|
||||
import {StringWrapper, isPresent} from '../../src/facade/lang';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {Observer} from 'rxjs/Observer';
|
||||
|
||||
|
@ -3,10 +3,10 @@ import {ReadyState, RequestMethod, ResponseType} from '../enums';
|
||||
import {Request} from '../static_request';
|
||||
import {Response} from '../static_response';
|
||||
import {Headers} from '../headers';
|
||||
import {ResponseOptions, BaseResponseOptions} from '../base_response_options';
|
||||
import {Injectable} from 'angular2/core';
|
||||
import {ResponseOptions} from '../base_response_options';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {BrowserXhr} from './browser_xhr';
|
||||
import {isPresent} from 'angular2/src/facade/lang';
|
||||
import {isPresent} from '../../src/facade/lang';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {Observer} from 'rxjs/Observer';
|
||||
import {isSuccess, getResponseURL} from '../http_utils';
|
||||
@ -102,7 +102,7 @@ export class XHRConnection implements Connection {
|
||||
* ### Example
|
||||
*
|
||||
* ```
|
||||
* import {Http, MyNodeBackend, HTTP_PROVIDERS, BaseRequestOptions} from 'angular2/http';
|
||||
* import {Http, MyNodeBackend, HTTP_PROVIDERS, BaseRequestOptions} from '@angular/http';
|
||||
* @Component({
|
||||
* viewProviders: [
|
||||
* HTTP_PROVIDERS,
|
||||
|
@ -1,8 +1,8 @@
|
||||
import {isPresent, isString} from 'angular2/src/facade/lang';
|
||||
import {isPresent, isString} from '../src/facade/lang';
|
||||
import {Headers} from './headers';
|
||||
import {RequestMethod} from './enums';
|
||||
import {RequestOptionsArgs} from './interfaces';
|
||||
import {Injectable} from 'angular2/core';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {URLSearchParams} from './url_search_params';
|
||||
import {normalizeMethodName} from './http_utils';
|
||||
|
||||
@ -19,7 +19,7 @@ import {normalizeMethodName} from './http_utils';
|
||||
* ### Example ([live demo](http://plnkr.co/edit/7Wvi3lfLq41aQPKlxB4O?p=preview))
|
||||
*
|
||||
* ```typescript
|
||||
* import {RequestOptions, Request, RequestMethod} from 'angular2/http';
|
||||
* import {RequestOptions, Request, RequestMethod} from '@angular/http';
|
||||
*
|
||||
* var options = new RequestOptions({
|
||||
* method: RequestMethod.Post,
|
||||
@ -75,7 +75,7 @@ export class RequestOptions {
|
||||
* ### Example ([live demo](http://plnkr.co/edit/6w8XA8YTkDRcPYpdB9dk?p=preview))
|
||||
*
|
||||
* ```typescript
|
||||
* import {RequestOptions, Request, RequestMethod} from 'angular2/http';
|
||||
* import {RequestOptions, Request, RequestMethod} from '@angular/http';
|
||||
*
|
||||
* var options = new RequestOptions({
|
||||
* method: RequestMethod.Post
|
||||
@ -117,9 +117,9 @@ export class RequestOptions {
|
||||
* ### Example ([live demo](http://plnkr.co/edit/LEKVSx?p=preview))
|
||||
*
|
||||
* ```typescript
|
||||
* import {provide} from 'angular2/core';
|
||||
* import {bootstrap} from 'angular2/platform/browser';
|
||||
* import {HTTP_PROVIDERS, Http, BaseRequestOptions, RequestOptions} from 'angular2/http';
|
||||
* import {provide} from '@angular/core';
|
||||
* import {bootstrap} from '@angular/platform-browser/browser';
|
||||
* import {HTTP_PROVIDERS, Http, BaseRequestOptions, RequestOptions} from '@angular/http';
|
||||
* import {App} from './myapp';
|
||||
*
|
||||
* class MyOptions extends BaseRequestOptions {
|
||||
@ -135,7 +135,7 @@ export class RequestOptions {
|
||||
* ### Example ([live demo](http://plnkr.co/edit/oyBoEvNtDhOSfi9YxaVb?p=preview))
|
||||
*
|
||||
* ```
|
||||
* import {BaseRequestOptions, Request, RequestMethod} from 'angular2/http';
|
||||
* import {BaseRequestOptions, Request, RequestMethod} from '@angular/http';
|
||||
*
|
||||
* var options = new BaseRequestOptions();
|
||||
* var req = new Request(options.merge({
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {Injectable} from 'angular2/core';
|
||||
import {isPresent, isJsObject} from 'angular2/src/facade/lang';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {isPresent, isJsObject} from '../src/facade/lang';
|
||||
import {Headers} from './headers';
|
||||
import {ResponseType} from './enums';
|
||||
import {ResponseOptionsArgs} from './interfaces';
|
||||
@ -20,7 +20,7 @@ import {ResponseOptionsArgs} from './interfaces';
|
||||
* ### Example ([live demo](http://plnkr.co/edit/P9Jkk8e8cz6NVzbcxEsD?p=preview))
|
||||
*
|
||||
* ```typescript
|
||||
* import {ResponseOptions, Response} from 'angular2/http';
|
||||
* import {ResponseOptions, Response} from '@angular/http';
|
||||
*
|
||||
* var options = new ResponseOptions({
|
||||
* body: '{"name":"Jeff"}'
|
||||
@ -75,7 +75,7 @@ export class ResponseOptions {
|
||||
* ### Example ([live demo](http://plnkr.co/edit/1lXquqFfgduTFBWjNoRE?p=preview))
|
||||
*
|
||||
* ```typescript
|
||||
* import {ResponseOptions, Response} from 'angular2/http';
|
||||
* import {ResponseOptions, Response} from '@angular/http';
|
||||
*
|
||||
* var options = new ResponseOptions({
|
||||
* body: {name: 'Jeff'}
|
||||
@ -115,10 +115,10 @@ export class ResponseOptions {
|
||||
* ### Example ([live demo](http://plnkr.co/edit/qv8DLT?p=preview))
|
||||
*
|
||||
* ```typescript
|
||||
* import {provide} from 'angular2/core';
|
||||
* import {bootstrap} from 'angular2/platform/browser';
|
||||
* import {provide} from '@angular/core';
|
||||
* import {bootstrap} from '@angular/platform-browser/browser';
|
||||
* import {HTTP_PROVIDERS, Headers, Http, BaseResponseOptions, ResponseOptions} from
|
||||
* 'angular2/http';
|
||||
* '@angular/http';
|
||||
* import {App} from './myapp';
|
||||
*
|
||||
* class MyOptions extends BaseResponseOptions {
|
||||
@ -134,15 +134,15 @@ export class ResponseOptions {
|
||||
* ### Example ([live demo](http://plnkr.co/edit/VngosOWiaExEtbstDoix?p=preview))
|
||||
*
|
||||
* ```
|
||||
* import {BaseResponseOptions, Response} from 'angular2/http';
|
||||
* import {BaseResponseOptions, Response} from '@angular/http';
|
||||
*
|
||||
* var options = new BaseResponseOptions();
|
||||
* var res = new Response(options.merge({
|
||||
* body: 'Angular2',
|
||||
* body: 'Angular',
|
||||
* headers: new Headers({framework: 'angular'})
|
||||
* }));
|
||||
* console.log('res.headers.get("framework"):', res.headers.get('framework')); // angular
|
||||
* console.log('res.text():', res.text()); // Angular2;
|
||||
* console.log('res.text():', res.text()); // Angular;
|
||||
* ```
|
||||
*/
|
||||
@Injectable()
|
||||
|
@ -1,5 +1,3 @@
|
||||
import {StringMapWrapper} from 'angular2/src/facade/collection';
|
||||
|
||||
/**
|
||||
* Supported http methods.
|
||||
*/
|
||||
|
1
modules/@angular/http/src/facade
Symbolic link
1
modules/@angular/http/src/facade
Symbolic link
@ -0,0 +1 @@
|
||||
../../facade/src
|
@ -1,12 +1,5 @@
|
||||
import {
|
||||
isPresent,
|
||||
isBlank,
|
||||
isJsObject,
|
||||
isType,
|
||||
StringWrapper,
|
||||
Json
|
||||
} from 'angular2/src/facade/lang';
|
||||
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
||||
import {isBlank} from '../src/facade/lang';
|
||||
import {BaseException} from '../src/facade/exceptions';
|
||||
import {
|
||||
isListLikeIterable,
|
||||
iterateListLike,
|
||||
@ -14,7 +7,7 @@ import {
|
||||
MapWrapper,
|
||||
StringMapWrapper,
|
||||
ListWrapper,
|
||||
} from 'angular2/src/facade/collection';
|
||||
} from '../src/facade/collection';
|
||||
|
||||
/**
|
||||
* Polyfill for [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers/Headers), as
|
||||
@ -26,7 +19,7 @@ import {
|
||||
* ### Example ([live demo](http://plnkr.co/edit/MTdwT6?p=preview))
|
||||
*
|
||||
* ```
|
||||
* import {Headers} from 'angular2/http';
|
||||
* import {Headers} from '@angular/http';
|
||||
*
|
||||
* var firstHeaders = new Headers();
|
||||
* firstHeaders.append('Content-Type', 'image/jpeg');
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {isString, isPresent, isBlank} from 'angular2/src/facade/lang';
|
||||
import {makeTypeError} from 'angular2/src/facade/exceptions';
|
||||
import {Injectable} from 'angular2/core';
|
||||
import {RequestOptionsArgs, Connection, ConnectionBackend} from './interfaces';
|
||||
import {isString, isPresent} from '../src/facade/lang';
|
||||
import {makeTypeError} from '../src/facade/exceptions';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {RequestOptionsArgs, ConnectionBackend} from './interfaces';
|
||||
import {Request} from './static_request';
|
||||
import {Response} from './static_response';
|
||||
import {BaseRequestOptions, RequestOptions} from './base_request_options';
|
||||
@ -42,7 +42,7 @@ function mergeOptions(defaultOpts: BaseRequestOptions, providedOpts: RequestOpti
|
||||
* ### Example
|
||||
*
|
||||
* ```typescript
|
||||
* import {Http, HTTP_PROVIDERS} from 'angular2/http';
|
||||
* import {Http, HTTP_PROVIDERS} from '@angular/http';
|
||||
* @Component({
|
||||
* selector: 'http-app',
|
||||
* viewProviders: [HTTP_PROVIDERS],
|
||||
@ -74,8 +74,8 @@ function mergeOptions(defaultOpts: BaseRequestOptions, providedOpts: RequestOpti
|
||||
* ### Example
|
||||
*
|
||||
* ```typescript
|
||||
* import {BaseRequestOptions, Http} from 'angular2/http';
|
||||
* import {MockBackend} from 'angular2/http/testing';
|
||||
* import {BaseRequestOptions, Http} from '@angular/http';
|
||||
* import {MockBackend} from '@angular/http/testing';
|
||||
* var injector = Injector.resolveAndCreate([
|
||||
* BaseRequestOptions,
|
||||
* MockBackend,
|
||||
|
@ -1,7 +1,6 @@
|
||||
import {isString} from 'angular2/src/facade/lang';
|
||||
import {isString} from '../src/facade/lang';
|
||||
import {RequestMethod} from './enums';
|
||||
import {makeTypeError} from 'angular2/src/facade/exceptions';
|
||||
import {Response} from './static_response';
|
||||
import {makeTypeError} from '../src/facade/exceptions';
|
||||
|
||||
export function normalizeMethodName(method: string | RequestMethod): RequestMethod {
|
||||
if (isString(method)) {
|
||||
@ -29,4 +28,4 @@ export function getResponseURL(xhr: any): string {
|
||||
return;
|
||||
}
|
||||
|
||||
export {isJsObject} from 'angular2/src/facade/lang';
|
||||
export {isJsObject} from '../src/facade/lang';
|
||||
|
@ -2,12 +2,12 @@
|
||||
// require('reflect-metadata');
|
||||
// require('es6-shim');
|
||||
// import {HTTP_PROVIDERS, JSONP_PROVIDERS, Http, Jsonp} from './http';
|
||||
// import {Injector} from 'angular2/core';
|
||||
// import {Injector} from '@angular/core';
|
||||
// export * from './http';
|
||||
|
||||
// /**
|
||||
// * TODO(jeffbcross): export each as their own top-level file, to require as:
|
||||
// * require('angular2/http'); require('http/jsonp');
|
||||
// * require('@angular/http'); require('http/jsonp');
|
||||
// */
|
||||
// export var http = Injector.resolveAndCreate([HTTP_PROVIDERS]).get(Http);
|
||||
// export var jsonp = Injector.resolveAndCreate([JSONP_PROVIDERS]).get(Jsonp);
|
||||
|
@ -1,7 +1,5 @@
|
||||
import {ReadyState, RequestMethod, ResponseType} from './enums';
|
||||
import {Headers} from './headers';
|
||||
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
||||
import {EventEmitter} from 'angular2/src/facade/async';
|
||||
import {Request} from './static_request';
|
||||
import {URLSearchParams} from './url_search_params';
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
"repository": <%= JSON.stringify(packageJson.repository) %>,
|
||||
"devDependencies": <%= JSON.stringify(packageJson.defaultDevDependencies) %>,
|
||||
"peerDependencies": {
|
||||
"angular2": "<%= packageJson.version %>",
|
||||
"@angular/core": "<%= packageJson.version %>",
|
||||
"rxjs": "<%= packageJson.dependencies['rxjs'] %>"
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import {RequestMethod} from './enums';
|
||||
import {RequestArgs} from './interfaces';
|
||||
import {Headers} from './headers';
|
||||
import {normalizeMethodName} from './http_utils';
|
||||
import {RegExpWrapper, isPresent, isJsObject, StringWrapper} from 'angular2/src/facade/lang';
|
||||
import {isPresent, StringWrapper} from '../src/facade/lang';
|
||||
|
||||
// TODO(jeffbcross): properly implement body accessors
|
||||
/**
|
||||
@ -19,8 +19,8 @@ import {RegExpWrapper, isPresent, isJsObject, StringWrapper} from 'angular2/src/
|
||||
* where it may be useful to generate a `Request` with arbitrary headers and search params.
|
||||
*
|
||||
* ```typescript
|
||||
* import {Injectable, Injector} from 'angular2/core';
|
||||
* import {HTTP_PROVIDERS, Http, Request, RequestMethod} from 'angular2/http';
|
||||
* import {Injectable, Injector} from '@angular/core';
|
||||
* import {HTTP_PROVIDERS, Http, Request, RequestMethod} from '@angular/http';
|
||||
*
|
||||
* @Injectable()
|
||||
* class AutoAuthenticator {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {ResponseType} from './enums';
|
||||
import {isString, isPresent, Json} from 'angular2/src/facade/lang';
|
||||
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
||||
import {isString, Json} from '../src/facade/lang';
|
||||
import {BaseException} from '../src/facade/exceptions';
|
||||
import {Headers} from './headers';
|
||||
import {ResponseOptions} from './base_response_options';
|
||||
import {isJsObject} from './http_utils';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {isPresent, isBlank} from 'angular2/src/facade/lang';
|
||||
import {Map, MapWrapper, ListWrapper, isListLikeIterable} from 'angular2/src/facade/collection';
|
||||
import {isPresent} from '../src/facade/lang';
|
||||
import {Map, ListWrapper, isListLikeIterable} from '../src/facade/collection';
|
||||
|
||||
function paramParser(rawParams: string = ''): Map<string, string[]> {
|
||||
var map = new Map<string, string[]>();
|
||||
|
@ -1,5 +1,4 @@
|
||||
import {
|
||||
AsyncTestCompleter,
|
||||
afterEach,
|
||||
beforeEach,
|
||||
ddescribe,
|
||||
@ -9,24 +8,25 @@ import {
|
||||
inject,
|
||||
it,
|
||||
xit,
|
||||
SpyObject
|
||||
} from 'angular2/testing_internal';
|
||||
import {ObservableWrapper, TimerWrapper} from 'angular2/src/facade/async';
|
||||
import {BrowserJsonp} from 'angular2/src/http/backends/browser_jsonp';
|
||||
} from '@angular/core/testing/testing_internal';
|
||||
import {AsyncTestCompleter, SpyObject} from '@angular/core/testing/testing_internal';
|
||||
import {ObservableWrapper} from '../../src/facade/async';
|
||||
import {BrowserJsonp} from '../../src/backends/browser_jsonp';
|
||||
import {
|
||||
JSONPConnection,
|
||||
JSONPConnection_,
|
||||
JSONPBackend,
|
||||
JSONPBackend_
|
||||
} from 'angular2/src/http/backends/jsonp_backend';
|
||||
import {provide, Injector, ReflectiveInjector} from 'angular2/core';
|
||||
import {isPresent, StringWrapper} from 'angular2/src/facade/lang';
|
||||
import {Request} from 'angular2/src/http/static_request';
|
||||
import {Response} from 'angular2/src/http/static_response';
|
||||
import {Map} from 'angular2/src/facade/collection';
|
||||
import {RequestOptions, BaseRequestOptions} from 'angular2/src/http/base_request_options';
|
||||
import {BaseResponseOptions, ResponseOptions} from 'angular2/src/http/base_response_options';
|
||||
import {ResponseType, ReadyState, RequestMethod} from 'angular2/src/http/enums';
|
||||
} from '../../src/backends/jsonp_backend';
|
||||
import {provide, Injector, ReflectiveInjector} from '@angular/core';
|
||||
import {isPresent, StringWrapper} from '../../src/facade/lang';
|
||||
import {TimerWrapper} from '../../src/facade/async';
|
||||
import {Request} from '../../src/static_request';
|
||||
import {Response} from '../../src/static_response';
|
||||
import {Map} from '../../src/facade/collection';
|
||||
import {RequestOptions, BaseRequestOptions} from '../../src/base_request_options';
|
||||
import {BaseResponseOptions, ResponseOptions} from '../../src/base_response_options';
|
||||
import {ResponseType, ReadyState, RequestMethod} from '../../src/enums';
|
||||
|
||||
var addEventListenerSpy: any;
|
||||
var existingScripts: MockBrowserJsonp[] = [];
|
||||
|
@ -1,5 +1,4 @@
|
||||
import {
|
||||
AsyncTestCompleter,
|
||||
afterEach,
|
||||
beforeEach,
|
||||
ddescribe,
|
||||
@ -9,19 +8,19 @@ import {
|
||||
inject,
|
||||
it,
|
||||
xit,
|
||||
SpyObject
|
||||
} from 'angular2/testing_internal';
|
||||
import {ObservableWrapper} from 'angular2/src/facade/async';
|
||||
import {BrowserXhr} from 'angular2/src/http/backends/browser_xhr';
|
||||
import {MockConnection, MockBackend} from 'angular2/src/http/backends/mock_backend';
|
||||
import {provide, Injector, ReflectiveInjector} from 'angular2/core';
|
||||
import {Request} from 'angular2/src/http/static_request';
|
||||
import {Response} from 'angular2/src/http/static_response';
|
||||
import {Headers} from 'angular2/src/http/headers';
|
||||
import {Map} from 'angular2/src/facade/collection';
|
||||
import {RequestOptions, BaseRequestOptions} from 'angular2/src/http/base_request_options';
|
||||
import {BaseResponseOptions, ResponseOptions} from 'angular2/src/http/base_response_options';
|
||||
import {ResponseType} from 'angular2/src/http/enums';
|
||||
} from '@angular/core/testing/testing_internal';
|
||||
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||
import {ObservableWrapper} from '../../src/facade/async';
|
||||
import {BrowserXhr} from '../../src/backends/browser_xhr';
|
||||
import {MockConnection, MockBackend} from '../../testing/mock_backend';
|
||||
import {provide, Injector, ReflectiveInjector} from '@angular/core';
|
||||
import {Request} from '../../src/static_request';
|
||||
import {Response} from '../../src/static_response';
|
||||
import {Headers} from '../../src/headers';
|
||||
import {Map} from '../../src/facade/collection';
|
||||
import {RequestOptions, BaseRequestOptions} from '../../src/base_request_options';
|
||||
import {BaseResponseOptions, ResponseOptions} from '../../src/base_response_options';
|
||||
import {ResponseType} from '../../src/enums';
|
||||
import {ReplaySubject} from 'rxjs/ReplaySubject';
|
||||
|
||||
export function main() {
|
||||
|
@ -1,5 +1,4 @@
|
||||
import {
|
||||
AsyncTestCompleter,
|
||||
afterEach,
|
||||
beforeEach,
|
||||
ddescribe,
|
||||
@ -9,19 +8,18 @@ import {
|
||||
inject,
|
||||
it,
|
||||
xit,
|
||||
SpyObject
|
||||
} from 'angular2/testing_internal';
|
||||
import {ObservableWrapper} from 'angular2/src/facade/async';
|
||||
import {BrowserXhr} from 'angular2/src/http/backends/browser_xhr';
|
||||
import {XHRConnection, XHRBackend} from 'angular2/src/http/backends/xhr_backend';
|
||||
import {provide, Injector, ReflectiveInjector} from 'angular2/core';
|
||||
import {Request} from 'angular2/src/http/static_request';
|
||||
import {Response} from 'angular2/src/http/static_response';
|
||||
import {Headers} from 'angular2/src/http/headers';
|
||||
import {Map} from 'angular2/src/facade/collection';
|
||||
import {RequestOptions, BaseRequestOptions} from 'angular2/src/http/base_request_options';
|
||||
import {BaseResponseOptions, ResponseOptions} from 'angular2/src/http/base_response_options';
|
||||
import {ResponseType} from 'angular2/src/http/enums';
|
||||
} from '@angular/core/testing/testing_internal';
|
||||
import {AsyncTestCompleter, SpyObject} from '@angular/core/testing/testing_internal';
|
||||
import {BrowserXhr} from '../../src/backends/browser_xhr';
|
||||
import {XHRConnection, XHRBackend} from '../../src/backends/xhr_backend';
|
||||
import {provide, Injector, ReflectiveInjector} from '@angular/core';
|
||||
import {Request} from '../../src/static_request';
|
||||
import {Response} from '../../src/static_response';
|
||||
import {Headers} from '../../src/headers';
|
||||
import {Map} from '../../src/facade/collection';
|
||||
import {RequestOptions, BaseRequestOptions} from '../../src/base_request_options';
|
||||
import {BaseResponseOptions, ResponseOptions} from '../../src/base_response_options';
|
||||
import {ResponseType} from '../../src/enums';
|
||||
|
||||
var abortSpy: any;
|
||||
var sendSpy: any;
|
||||
|
@ -1,5 +1,4 @@
|
||||
import {
|
||||
AsyncTestCompleter,
|
||||
beforeEach,
|
||||
ddescribe,
|
||||
describe,
|
||||
@ -8,9 +7,9 @@ import {
|
||||
inject,
|
||||
it,
|
||||
xit
|
||||
} from 'angular2/testing_internal';
|
||||
import {BaseRequestOptions, RequestOptions} from 'angular2/src/http/base_request_options';
|
||||
import {RequestMethod} from 'angular2/src/http/enums';
|
||||
} from '@angular/core/testing/testing_internal';
|
||||
import {BaseRequestOptions, RequestOptions} from '../src/base_request_options';
|
||||
import {RequestMethod} from '../src/enums';
|
||||
|
||||
export function main() {
|
||||
describe('BaseRequestOptions', () => {
|
||||
|
@ -1,8 +1,7 @@
|
||||
import {Headers} from 'angular2/src/http/headers';
|
||||
import {Json} from 'angular2/src/facade/lang';
|
||||
import {Map, StringMapWrapper} from 'angular2/src/facade/collection';
|
||||
import {Headers} from '../src/headers';
|
||||
import {Json} from '../src/facade/lang';
|
||||
import {Map, StringMapWrapper} from '../src/facade/collection';
|
||||
import {
|
||||
AsyncTestCompleter,
|
||||
beforeEach,
|
||||
ddescribe,
|
||||
describe,
|
||||
@ -11,7 +10,7 @@ import {
|
||||
inject,
|
||||
it,
|
||||
xit
|
||||
} from 'angular2/testing_internal';
|
||||
} from '@angular/core/testing/testing_internal';
|
||||
|
||||
export function main() {
|
||||
describe('Headers', () => {
|
||||
|
@ -1,5 +1,4 @@
|
||||
import {
|
||||
AsyncTestCompleter,
|
||||
afterEach,
|
||||
beforeEach,
|
||||
ddescribe,
|
||||
@ -9,9 +8,10 @@ import {
|
||||
inject,
|
||||
it,
|
||||
xit
|
||||
} from 'angular2/testing_internal';
|
||||
import {Injector, provide, ReflectiveInjector} from 'angular2/core';
|
||||
import {MockBackend, MockConnection} from 'angular2/src/http/backends/mock_backend';
|
||||
} from '@angular/core/testing/testing_internal';
|
||||
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||
import {Injector, provide, ReflectiveInjector} from '@angular/core';
|
||||
import {MockBackend, MockConnection} from '../testing/mock_backend';
|
||||
import {
|
||||
BaseRequestOptions,
|
||||
ConnectionBackend,
|
||||
@ -27,7 +27,7 @@ import {
|
||||
JSONPBackend,
|
||||
Http,
|
||||
Jsonp
|
||||
} from 'angular2/http';
|
||||
} from '../http';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {Subject} from 'rxjs/Subject';
|
||||
|
||||
|
@ -2,10 +2,10 @@ import {
|
||||
describe,
|
||||
expect,
|
||||
it,
|
||||
} from 'angular2/testing_internal';
|
||||
} from '@angular/core/testing/testing_internal';
|
||||
|
||||
import {ResponseOptions} from 'angular2/src/http/base_response_options';
|
||||
import {Response} from 'angular2/src/http/static_response';
|
||||
import {ResponseOptions} from '../src/base_response_options';
|
||||
import {Response} from '../src/static_response';
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
import {
|
||||
AsyncTestCompleter,
|
||||
beforeEach,
|
||||
ddescribe,
|
||||
describe,
|
||||
@ -8,8 +7,8 @@ import {
|
||||
inject,
|
||||
it,
|
||||
xit
|
||||
} from 'angular2/testing_internal';
|
||||
import {URLSearchParams} from 'angular2/src/http/url_search_params';
|
||||
} from '@angular/core/testing/testing_internal';
|
||||
import {URLSearchParams} from '../src/url_search_params';
|
||||
|
||||
export function main() {
|
||||
describe('URLSearchParams', () => {
|
||||
|
@ -1 +1 @@
|
||||
export * from 'angular2/src/http/backends/mock_backend';
|
||||
export * from './testing/mock_backend';
|
||||
|
@ -1,10 +1,10 @@
|
||||
import {Injectable} from 'angular2/core';
|
||||
import {Request} from '../static_request';
|
||||
import {Response} from '../static_response';
|
||||
import {ReadyState} from '../enums';
|
||||
import {Connection, ConnectionBackend} from '../interfaces';
|
||||
import {isPresent} from 'angular2/src/facade/lang';
|
||||
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {Request} from '../src/static_request';
|
||||
import {Response} from '../src/static_response';
|
||||
import {ReadyState} from '../src/enums';
|
||||
import {Connection, ConnectionBackend} from '../src/interfaces';
|
||||
import {isPresent} from '../src/facade/lang';
|
||||
import {BaseException} from '../src/facade/exceptions';
|
||||
import {Subject} from 'rxjs/Subject';
|
||||
import {ReplaySubject} from 'rxjs/ReplaySubject';
|
||||
import {take} from 'rxjs/operator/take';
|
||||
@ -98,8 +98,8 @@ export class MockConnection implements Connection {
|
||||
* ### Example
|
||||
*
|
||||
* ```
|
||||
* import {BaseRequestOptions, Http} from 'angular2/http';
|
||||
* import {MockBackend} from 'angular2/http/testing';
|
||||
* import {BaseRequestOptions, Http} from '@angular/http';
|
||||
* import {MockBackend} from '@angular/http/testing';
|
||||
* it('should get some data', inject([AsyncTestCompleter], (async) => {
|
||||
* var connection;
|
||||
* var injector = Injector.resolveAndCreate([
|
||||
@ -131,9 +131,9 @@ export class MockBackend implements ConnectionBackend {
|
||||
* ### Example
|
||||
*
|
||||
* ```
|
||||
* import {Http, BaseRequestOptions} from 'angular2/http';
|
||||
* import {MockBackend} from 'angular2/http/testing';
|
||||
* import {Injector} from 'angular2/core';
|
||||
* import {Http, BaseRequestOptions} from '@angular/http';
|
||||
* import {MockBackend} from '@angular/http/testing';
|
||||
* import {Injector} from '@angular/core';
|
||||
*
|
||||
* it('should get a response', () => {
|
||||
* var connection; //this will be set when a new connection is emitted from the backend.
|
||||
|
23
modules/@angular/http/tsconfig-es2015.json
Normal file
23
modules/@angular/http/tsconfig-es2015.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"declaration": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"module": "es2015",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "../../../dist/packages-dist/http/esm",
|
||||
"paths": {
|
||||
"@angular/core": ["../../../dist/packages-dist/core"]
|
||||
},
|
||||
"rootDir": ".",
|
||||
"sourceMap": true,
|
||||
"sourceRoot": ".",
|
||||
"target": "es2015"
|
||||
},
|
||||
"files": [
|
||||
"index.ts",
|
||||
"testing.ts",
|
||||
"../../../node_modules/zone.js/dist/zone.js.d.ts"
|
||||
]
|
||||
}
|
26
modules/@angular/http/tsconfig.json
Normal file
26
modules/@angular/http/tsconfig.json
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"declaration": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "../../../dist/packages-dist/http/",
|
||||
"paths": {
|
||||
"@angular/core": ["../../../dist/packages-dist/core"]
|
||||
},
|
||||
"rootDir": ".",
|
||||
"sourceMap": true,
|
||||
"sourceRoot": ".",
|
||||
"target": "es5"
|
||||
},
|
||||
"files": [
|
||||
"index.ts",
|
||||
"testing.ts",
|
||||
"../typings/es6-collections/es6-collections.d.ts",
|
||||
"../typings/es6-promise/es6-promise.d.ts",
|
||||
"../manual_typings/globals.d.ts",
|
||||
"../../../node_modules/zone.js/dist/zone.js.d.ts"
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user