mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-17 02:54:21 +08:00
feat(@schematics/angular): remove @angular/http
as it's deprecated
This commit is contained in:
parent
3ae3fa3a1d
commit
1a6b471c82
@ -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 %>",
|
||||
|
@ -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' }
|
||||
])
|
||||
|
@ -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'))
|
||||
|
@ -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'))
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user