-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Can you move HttpModule in MdIconModule to component scope (or don't import it)? #2616
Comments
@alxhub do you have any input on how a component that depends on |
I'm facing the same issue. I created a custom http service:
I provide this service in app.module.ts:
If I don't use Material Design, this SecureHttp service is used in all classes that inject the Http service. But if I do include MaterialModule in other modules as well, the default Http service is used instead of my SecureHttp, because the HttpModule is used in MdIconModule. I can fix this by adding Is this intended behavior? |
Had some discussion w/ @alxhub about this. The idea is to change md-icon to optionally inject |
HI @jelbourn , @EladBezalel Upon your last comment, I thought about this logic.
|
Makes `@angular/http` an optional dependency since it is only being used by the icon module. An error will be thrown only if the user runs into something that requires the `HttpModule`. Fixes angular#2616.
* Makes `@angular/http` an optional dependency since it is only being used by the icon module. An error will be thrown only if the user runs into something that requires the `HttpModule`. * Moves the various icon error classes into `icon-errors.ts`. * Moves the icon registry provider next to the registry itself, instead of in the same file as the icon directive. Fixes angular#2616.
* Makes `@angular/http` an optional dependency since it is only being used by the icon module. An error will be thrown only if the user runs into something that requires the `HttpModule`. * Moves the various icon error classes into `icon-errors.ts`. * Moves the icon registry provider next to the registry itself, instead of in the same file as the icon directive. Fixes angular#2616.
Done in #3792 |
* Makes `@angular/http` an optional dependency since it is only being used by the icon module. An error will be thrown only if the user runs into something that requires the `HttpModule`. * Moves the various icon error classes into `icon-errors.ts`. * Moves the icon registry provider next to the registry itself, instead of in the same file as the icon directive. Fixes angular#2616.
* Makes `@angular/http` an optional dependency since it is only being used by the icon module. An error will be thrown only if the user runs into something that requires the `HttpModule`. * Moves the various icon error classes into `icon-errors.ts`. * Moves the icon registry provider next to the registry itself, instead of in the same file as the icon directive. Fixes angular#2616.
* Makes `@angular/http` an optional dependency since it is only being used by the icon module. An error will be thrown only if the user runs into something that requires the `HttpModule`. * Moves the various icon error classes into `icon-errors.ts`. * Moves the icon registry provider next to the registry itself, instead of in the same file as the icon directive. Fixes angular#2616.
* Makes `@angular/http` an optional dependency since it is only being used by the icon module. An error will be thrown only if the user runs into something that requires the `HttpModule`. * Moves the various icon error classes into `icon-errors.ts`. * Moves the icon registry provider next to the registry itself, instead of in the same file as the icon directive. Fixes angular#2616.
* Makes `@angular/http` an optional dependency since it is only being used by the icon module. An error will be thrown only if the user runs into something that requires the `HttpModule`. * Moves the various icon error classes into `icon-errors.ts`. * Moves the icon registry provider next to the registry itself, instead of in the same file as the icon directive. Fixes #2616.
If I install (I get similar errors with |
@csvn please file a new issue |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
Bug
What is the current behavior?
The feature modules that import MaterialModule (import MdIconModule) will create separated http provider and override the application-wide customized Http.
What are the steps to reproduce?
The following link shows the problem.
http://plnkr.co/edit/hDLOuvRPWxPIY3TwX4GB?p=preview
What is the use-case or motivation for changing an existing behavior?
Cannot use application-wide customized Http in feature module that import MaterialModule
Which versions of Angular, Material, OS, browsers are affected?
@angular@2.4.2
@angular/material@2.0.0-beta.1
Google Chrome Version 57.0.2970.0 (Official Build) dev (64-bit)
Window 10
The text was updated successfully, but these errors were encountered: