Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw custom error message for missing http client module #101

Open
vmasek opened this issue Nov 23, 2020 · 0 comments
Open

Throw custom error message for missing http client module #101

vmasek opened this issue Nov 23, 2020 · 0 comments
Labels
enhancement Request for a change or improvement of existing functionality
Projects

Comments

@vmasek
Copy link
Member

vmasek commented Nov 23, 2020

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

@vmasek vmasek added the enhancement Request for a change or improvement of existing functionality label Nov 23, 2020
@vmasek vmasek added this to Planned in Main board Dec 2, 2020
@vmasek vmasek moved this from Planned to In progress in Main board Dec 10, 2020
@vmasek vmasek moved this from In progress to Planned in Main board Dec 10, 2020
@vmasek vmasek moved this from Planned to To do in Main board Dec 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request for a change or improvement of existing functionality
Projects
Status: To do
Development

No branches or pull requests

1 participant