docs: migrate examples from @angular/http to @angular/common/http (#28296)
PR Close #28296
This commit is contained in:
committed by
Kara Erickson
parent
4b9eb6185f
commit
a29ce57732
@@ -8,7 +8,6 @@
|
||||
"@angular/compiler",
|
||||
"@angular/core",
|
||||
"@angular/forms",
|
||||
"@angular/http",
|
||||
"@angular/platform-browser",
|
||||
"@angular/platform-browser-dynamic",
|
||||
"@angular/router",
|
||||
|
||||
@@ -17,11 +17,10 @@
|
||||
"@angular/compiler": "^7.0.0",
|
||||
"@angular/core": "^7.0.0",
|
||||
"@angular/forms": "^7.0.0",
|
||||
"@angular/http": "^7.0.0",
|
||||
"@angular/platform-browser": "^7.0.0",
|
||||
"@angular/platform-browser-dynamic": "^7.0.0",
|
||||
"@angular/router": "^7.0.0",
|
||||
"angular-in-memory-web-api": "^0.6.0",
|
||||
"angular-in-memory-web-api": "^0.8.0",
|
||||
"core-js": "^2.5.4",
|
||||
"rxjs": "^6.3.0",
|
||||
"web-animations-js": "^2.3.1",
|
||||
|
||||
@@ -20,11 +20,10 @@
|
||||
"@angular/compiler": "^7.0.0",
|
||||
"@angular/core": "^7.0.0",
|
||||
"@angular/forms": "^7.0.0",
|
||||
"@angular/http": "^7.0.0",
|
||||
"@angular/platform-browser": "^7.0.0",
|
||||
"@angular/platform-browser-dynamic": "^7.0.0",
|
||||
"@angular/router": "^7.0.0",
|
||||
"angular-in-memory-web-api": "^0.6.0",
|
||||
"angular-in-memory-web-api": "^0.8.0",
|
||||
"core-js": "^2.5.4",
|
||||
"rxjs": "^6.3.0",
|
||||
"web-animations-js": "^2.3.1",
|
||||
|
||||
@@ -17,12 +17,11 @@
|
||||
"@angular/compiler": "^7.0.0",
|
||||
"@angular/core": "^7.0.0",
|
||||
"@angular/forms": "^7.0.0",
|
||||
"@angular/http": "^7.0.0",
|
||||
"@angular/platform-browser": "^7.0.0",
|
||||
"@angular/platform-browser-dynamic": "^7.0.0",
|
||||
"@angular/router": "^7.0.0",
|
||||
"@angular/service-worker": "^7.0.0",
|
||||
"angular-in-memory-web-api": "^0.6.0",
|
||||
"angular-in-memory-web-api": "^0.8.0",
|
||||
"core-js": "^2.5.4",
|
||||
"rxjs": "^6.3.0",
|
||||
"web-animations-js": "^2.3.1",
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
|
||||
'@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.umd.js',
|
||||
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
|
||||
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
|
||||
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
|
||||
'@angular/router/upgrade': 'npm:@angular/router/bundles/router-upgrade.umd.js',
|
||||
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
|
||||
|
||||
@@ -54,7 +54,6 @@ can be found in the LICENSE file at http://angular.io/license
|
||||
'@angular/platform-browser': 'ng:platform-browser-builds/master/bundles/platform-browser.umd.js',
|
||||
'@angular/platform-browser/animations': 'ng:animations-builds/master/bundles/platform-browser-animations.umd.js',
|
||||
'@angular/platform-browser-dynamic': 'ng:platform-browser-dynamic-builds/master/bundles/platform-browser-dynamic.umd.js',
|
||||
'@angular/http': 'ng:http-builds/master/bundles/http.umd.js',
|
||||
'@angular/router': 'ng:router-builds/master/bundles/router.umd.js',
|
||||
'@angular/router/upgrade': 'ng:router-builds/master/bundles/router-upgrade.umd.js',
|
||||
'@angular/forms': 'ng:forms-builds/master/bundles/forms.umd.js',
|
||||
@@ -68,7 +67,6 @@ can be found in the LICENSE file at http://angular.io/license
|
||||
'@angular/compiler/testing': 'ng:compiler-builds/master/bundles/compiler-testing.umd.js',
|
||||
'@angular/platform-browser/testing': 'ng:platform-browser-builds/master/bundles/platform-browser-testing.umd.js',
|
||||
'@angular/platform-browser-dynamic/testing': 'ng:platform-browser-dynamic-builds/master/bundles/platform-browser-dynamic-testing.umd.js',
|
||||
'@angular/http/testing': 'ng:http-builds/master/bundles/http-testing.umd.js',
|
||||
'@angular/router/testing': 'ng:router-builds/master/bundles/router-testing.umd.js',
|
||||
'@angular/forms/testing': 'ng:forms-builds/master/bundles/forms-testing.umd.js',
|
||||
|
||||
|
||||
@@ -50,7 +50,6 @@ can be found in the LICENSE file at http://angular.io/license
|
||||
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
|
||||
'@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.umd.js',
|
||||
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
|
||||
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
|
||||
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
|
||||
'@angular/router/upgrade': 'npm:@angular/router/bundles/router-upgrade.umd.js',
|
||||
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
"@nguniversal/common": "^7.0.0",
|
||||
"@nguniversal/express-engine": "^7.0.0",
|
||||
"@nguniversal/module-map-ngfactory-loader": "^7.0.0",
|
||||
"angular-in-memory-web-api": "^0.6.0",
|
||||
"angular-in-memory-web-api": "^0.8.0",
|
||||
"core-js": "^2.5.4",
|
||||
"rxjs": "^6.3.0",
|
||||
"web-animations-js": "^2.3.1",
|
||||
|
||||
+2355
-2407
File diff suppressed because it is too large
Load Diff
@@ -17,17 +17,10 @@ describe('angular-api-package: computeApiBreadCrumbs processor', () => {
|
||||
const API_DOC_TYPES_TO_RENDER = ['class', 'interface', 'package'];
|
||||
const processor = processorFactory(API_DOC_TYPES_TO_RENDER);
|
||||
|
||||
const httpPackage = { docType: 'package', name: '@angular/http', id: 'http', path: 'http', isPrimaryPackage: true };
|
||||
const httpTestingPackage = { docType: 'package', name: '@angular/http/testing', id: 'http/testing', path: 'http/testing', packageInfo: { primary: httpPackage } };
|
||||
const testRequestClass = { docType: 'class', name: 'TestRequest', path: 'http/testing/test-request', moduleDoc: httpTestingPackage };
|
||||
|
||||
const docs = [
|
||||
{ docType: 'class', name: 'ClassA', path: 'module-1/class-a', moduleDoc: { id: 'moduleOne', path: 'module-1' } },
|
||||
{ docType: 'interface', name: 'InterfaceB', path: 'module-2/interface-b', moduleDoc: { id: 'moduleTwo', path: 'module-2' } },
|
||||
{ docType: 'guide', name: 'Guide One', path: 'guide/guide-1' },
|
||||
httpPackage,
|
||||
httpTestingPackage,
|
||||
testRequestClass
|
||||
];
|
||||
processor.$process(docs);
|
||||
|
||||
@@ -42,20 +35,5 @@ describe('angular-api-package: computeApiBreadCrumbs processor', () => {
|
||||
{ text: 'InterfaceB', path: 'module-2/interface-b' },
|
||||
]);
|
||||
expect(docs[2].breadCrumbs).toBeUndefined();
|
||||
expect(docs[3].breadCrumbs).toEqual([
|
||||
{ text: 'API', path: '/api' },
|
||||
{ text: '@angular/http', path: 'http' },
|
||||
]);
|
||||
expect(docs[4].breadCrumbs).toEqual([
|
||||
{ text: 'API', path: '/api' },
|
||||
{ text: '@angular/http', path: 'http' },
|
||||
{ text: '@angular/http/testing', path: 'http/testing' },
|
||||
]);
|
||||
expect(docs[5].breadCrumbs).toEqual([
|
||||
{ text: 'API', path: '/api' },
|
||||
{ text: '@angular/http', path: 'http' },
|
||||
{ text: '@angular/http/testing', path: 'http/testing' },
|
||||
{ text: 'TestRequest', path: 'http/testing/test-request' },
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -40,13 +40,11 @@ describe('generateApiListDoc processor', () => {
|
||||
const docs = [
|
||||
{ docType: 'package', id: '@angular/common/index', exports: [], path: 'common' },
|
||||
{ docType: 'package', id: '@angular/core/index', exports: [], path: 'core' },
|
||||
{ docType: 'package', id: '@angular/http/index', exports: [], path: 'http' },
|
||||
];
|
||||
processor.$process(docs);
|
||||
expect(docs[3].data).toEqual([
|
||||
expect(docs[2].data).toEqual([
|
||||
{ name: '@angular/common', title: '@angular/common', items: [], path: 'common' },
|
||||
{ name: '@angular/core', title: '@angular/core', items: [], path: 'core' },
|
||||
{ name: '@angular/http', title: '@angular/http', items: [], path: 'http' },
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user