feat(@schematics/angular): remove @angular/http as it's deprecated

This commit is contained in:
Suguru Inatomi 2018-09-28 09:31:56 +09:00 committed by Alex Eagle
parent 3ae3fa3a1d
commit 1a6b471c82
5 changed files with 14 additions and 3 deletions

View File

@ -16,7 +16,6 @@
"@angular/compiler": "<%= experimentalAngularNext ? 'next' : latestVersions.Angular %>",
"@angular/core": "<%= experimentalAngularNext ? 'next' : latestVersions.Angular %>",
"@angular/forms": "<%= experimentalAngularNext ? 'next' : latestVersions.Angular %>",
"@angular/http": "<%= experimentalAngularNext ? 'next' : latestVersions.Angular %>",
"@angular/platform-browser": "<%= experimentalAngularNext ? 'next' : latestVersions.Angular %>",
"@angular/platform-browser-dynamic": "<%= experimentalAngularNext ? 'next' : latestVersions.Angular %>",
"@angular/router": "<%= experimentalAngularNext ? 'next' : latestVersions.Angular %>",

View File

@ -34,7 +34,7 @@ export default function() {
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { HttpClientModule } from '@angular/common/http';
import { AppComponent } from './app.component';
import { RouterModule } from '@angular/router';
@ -46,7 +46,7 @@ export default function() {
imports: [
BrowserModule,
FormsModule,
HttpModule,
HttpClientModule,
RouterModule.forRoot([
{ path: 'lazy', loadChildren: './lazy/lazy.module#LazyModule' }
])

View File

@ -18,9 +18,11 @@ export default function () {
}
let platformServerVersion = readNgVersion();
let httpVersion = readNgVersion();
if (getGlobalVariable('argv')['ng-snapshots']) {
platformServerVersion = 'github:angular/platform-server-builds';
httpVersion = 'github:angular/http-builds';
}
@ -33,6 +35,8 @@ export default function () {
.then(() => updateJsonFile('package.json', packageJson => {
const dependencies = packageJson['dependencies'];
dependencies['@angular/platform-server'] = platformServerVersion;
// ServerModule depends on @angular/http regardless the app's dependency.
dependencies['@angular/http'] = httpVersion;
})
.then(() => npm('install'))
.then(() => ng('build', '--optimization'))

View File

@ -19,9 +19,11 @@ export default function () {
}
let platformServerVersion = readNgVersion();
let httpVersion = readNgVersion();
if (getGlobalVariable('argv')['ng-snapshots']) {
platformServerVersion = 'github:angular/platform-server-builds';
httpVersion = 'github:angular/http-builds';
}
return Promise.resolve()
@ -134,6 +136,8 @@ export default function () {
.then(() => updateJsonFile('package.json', packageJson => {
const dependencies = packageJson['dependencies'];
dependencies['@angular/platform-server'] = platformServerVersion;
// ServerModule depends on @angular/http regardless the app's dependency.
dependencies['@angular/http'] = httpVersion;
})
.then(() => npm('install')))
.then(() => ng('run', 'test-project:app-shell'))

View File

@ -20,9 +20,11 @@ export default function () {
}
let platformServerVersion = readNgVersion();
let httpVersion = readNgVersion();
if (getGlobalVariable('argv')['ng-snapshots']) {
platformServerVersion = 'github:angular/platform-server-builds';
httpVersion = 'github:angular/http-builds';
}
// Skip this test in Angular 2/4.
@ -34,6 +36,8 @@ export default function () {
.then(() => updateJsonFile('package.json', packageJson => {
const dependencies = packageJson['dependencies'];
dependencies['@angular/platform-server'] = platformServerVersion;
// ServerModule depends on @angular/http regardless the app's dependency.
dependencies['@angular/http'] = httpVersion;
}))
.then(() => updateJsonFile('angular.json', workspaceJson => {
const appArchitect = workspaceJson.projects['test-project'].architect;