HttpClient is an evolution of the existing Angular HTTP API, which exists alongside of it in a separate package, @angular/common/http. This structure ensures that existing codebases can slowly migrate to the new API. The new API improves significantly on the ergonomics and features of the legacy API. A partial list of new features includes: * Typed, synchronous response body access, including support for JSON body types * JSON is an assumed default and no longer needs to be explicitly parsed * Interceptors allow middleware logic to be inserted into the pipeline * Immutable request/response objects * Progress events for both request upload and response download * Post-request verification & flush based testing framework
		
			
				
	
	
		
			30 lines
		
	
	
		
			829 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			829 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| /**
 | |
|  * @license
 | |
|  * Copyright Google Inc. All Rights Reserved.
 | |
|  *
 | |
|  * Use of this source code is governed by an MIT-style license that can be
 | |
|  * found in the LICENSE file at https://angular.io/license
 | |
|  */
 | |
| 
 | |
| import resolve from 'rollup-plugin-node-resolve';
 | |
| 
 | |
| const globals = {
 | |
|   '@angular/core': 'ng.core',
 | |
|   '@angular/platform-browser': 'ng.platformBrowser',
 | |
|   '@angular/common/http': 'ng.common.http',
 | |
|   'rxjs/Observable': 'Rx',
 | |
|   'rxjs/ReplaySubject': 'Rx',
 | |
|   'rxjs/Subject': 'Rx',
 | |
| };
 | |
| 
 | |
| export default {
 | |
|   entry: '../../../../dist/packages-dist/common/@angular/common/http/testing.es5.js',
 | |
|   dest: '../../../../dist/packages-dist/common/bundles/common-http-testing.umd.js',
 | |
|   format: 'umd',
 | |
|   exports: 'named',
 | |
|   moduleName: 'ng.common.http.testing',
 | |
|   plugins: [resolve()],
 | |
|   external: Object.keys(globals),
 | |
|   globals: globals
 | |
| };
 |