flowup / api-client-generator

Angular REST API client generator from Swagger YAML or JSON file with camel case settigs
MIT License
115 stars 21 forks source link

Throw custom error message for missing http client module #101

Open vmasek opened 3 years ago

vmasek commented 3 years ago

Something like this could do

export class ApiClientModule {
    constructor(@Optional() http: HttpClient) {
        if (!http) {
            throw new Error('You need to import the HttpClientModule in your main module (usually AppModule).');
        }
    }
}