forked from loafle/openapi-generator-original
Bugfix/6727 import http client module (#6757)
* [angular-typescript] imports HttpClientModule HttpModule has no effect, since the new `HttpClient` is now used. fixes #6727 * #6727: import http client module or http module, depending on setting * #6727: import http client module or http module, depending on setting * #6727: generate samples
This commit is contained in:
parent
98e5612c84
commit
f4ac6feae2
@ -1,6 +1,11 @@
|
||||
import { NgModule, ModuleWithProviders } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
{{#useHttpClient}}
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
{{/useHttpClient}}
|
||||
{{^useHttpClient}}
|
||||
import { HttpModule } from '@angular/http';
|
||||
{{/useHttpClient}}
|
||||
import { Configuration } from './configuration';
|
||||
|
||||
{{#apiInfo}}
|
||||
@ -10,7 +15,7 @@ import { {{classname}} } from './{{importPath}}';
|
||||
{{/apiInfo}}
|
||||
|
||||
@NgModule({
|
||||
imports: [ CommonModule, HttpModule ],
|
||||
imports: [ CommonModule, {{#useHttpClient}}HttpClientModule{{/useHttpClient}}{{^useHttpClient}}HttpModule{{/useHttpClient}} ],
|
||||
declarations: [],
|
||||
exports: [],
|
||||
providers: [ {{#apiInfo}}{{#apis}}{{classname}}{{#hasMore}}, {{/hasMore}}{{/apis}}{{/apiInfo}} ]
|
||||
|
@ -19,3 +19,5 @@ export interface ApiResponse {
|
||||
type?: string;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,3 +18,5 @@ export interface Category {
|
||||
id?: number;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
|
||||
|
@ -33,3 +33,5 @@ export namespace Order {
|
||||
Delivered: 'delivered' as StatusEnum
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -35,3 +35,5 @@ export namespace Pet {
|
||||
Sold: 'sold' as StatusEnum
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,3 +18,5 @@ export interface Tag {
|
||||
id?: number;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
|
||||
|
@ -27,3 +27,5 @@ export interface User {
|
||||
*/
|
||||
userStatus?: number;
|
||||
}
|
||||
|
||||
|
||||
|
@ -19,3 +19,5 @@ export interface ApiResponse {
|
||||
type?: string;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,3 +18,5 @@ export interface Category {
|
||||
id?: number;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
|
||||
|
@ -33,3 +33,5 @@ export namespace Order {
|
||||
Delivered: 'delivered' as StatusEnum
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -35,3 +35,5 @@ export namespace Pet {
|
||||
Sold: 'sold' as StatusEnum
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,3 +18,5 @@ export interface Tag {
|
||||
id?: number;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
|
||||
|
@ -27,3 +27,5 @@ export interface User {
|
||||
*/
|
||||
userStatus?: number;
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,3 +18,5 @@ export interface Category {
|
||||
id?: number;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
|
||||
|
@ -33,3 +33,5 @@ export namespace Order {
|
||||
Delivered: 'delivered' as StatusEnum
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -35,3 +35,5 @@ export namespace Pet {
|
||||
Sold: 'sold' as StatusEnum
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,3 +18,5 @@ export interface Tag {
|
||||
id?: number;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
|
||||
|
@ -27,3 +27,5 @@ export interface User {
|
||||
*/
|
||||
userStatus?: number;
|
||||
}
|
||||
|
||||
|
||||
|
@ -19,3 +19,5 @@ export interface ApiResponse {
|
||||
type?: string;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { NgModule, ModuleWithProviders } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { HttpModule } from '@angular/http';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { Configuration } from './configuration';
|
||||
|
||||
import { PetService } from './api/pet.service';
|
||||
@ -8,7 +8,7 @@ import { StoreService } from './api/store.service';
|
||||
import { UserService } from './api/user.service';
|
||||
|
||||
@NgModule({
|
||||
imports: [ CommonModule, HttpModule ],
|
||||
imports: [ CommonModule, HttpClientModule ],
|
||||
declarations: [],
|
||||
exports: [],
|
||||
providers: [ PetService, StoreService, UserService ]
|
||||
|
@ -19,3 +19,5 @@ export interface ApiResponse {
|
||||
type?: string;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,3 +18,5 @@ export interface Category {
|
||||
id?: number;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
|
||||
|
@ -33,3 +33,5 @@ export namespace Order {
|
||||
Delivered: 'delivered' as StatusEnum
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -35,3 +35,5 @@ export namespace Pet {
|
||||
Sold: 'sold' as StatusEnum
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,3 +18,5 @@ export interface Tag {
|
||||
id?: number;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
|
||||
|
@ -27,3 +27,5 @@ export interface User {
|
||||
*/
|
||||
userStatus?: number;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user