Skip to content

Throw custom error message for missing http client module #101

Open
@vmasek

Description

@vmasek

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).');
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementRequest for a change or improvement of existing functionality

    Type

    No type

    Projects

    Status

    To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions