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

docs(ng-icons): update responseType in custom SVG loader example #90

Conversation

bimendra
Copy link
Contributor

This pull request updates the documentation for the provideNgIconLoader usage example. The current documentation does not specify the responseType in the HTTP request, which leads to a type mismatch error as the HttpClient.get method defaults to returning an Observable<Object>.

Changes made:

  • Added { responseType: 'text' } as the second argument to the http.get method to ensure the response is treated as a plain text string.

This modification ensures that when fetching custom SVG icons, the response is handled as an Observable<string>, which aligns with the expected return type for the provideNgIconLoader function. The update should prevent type mismatch errors and clarify the correct usage for future developers.

By correcting this example, developers will have a smoother experience when implementing custom SVG icon loaders using the ng-icons library.

Provide correct responseType option in the documentation for loading custom SVG icons using provideNgIconLoader. This change specifies the responseType as 'text' to ensure the HttpClient.get method returns an Observable<string> that can be used by the icon loader function.  This correction addresses an issue where the documentation example did not match the expected function signature, potentially causing type mismatch errors for developers implementing the custom SVG loader.
Copy link
Collaborator

@ashley-hunter ashley-hunter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great suggestion, thank you very much for your contribution!

@ashley-hunter ashley-hunter merged commit 3f7b75a into ng-icons:master Feb 13, 2024
5 checks passed
@bimendra bimendra deleted the fix-doc-error-dynamically-loading-icons branch February 13, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants