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

fix(http): cannot use JSONP_BINDINGS and HTTP_BINDINGS in same injector #3365

Closed
jeffbcross opened this issue Jul 29, 2015 · 1 comment
Closed

Comments

@jeffbcross
Copy link
Contributor

If I create an injector as follows, Http will use the JsonpBackend instead of XHRBackend.

var injector = Injector.resolveAndCreate([HTTP_BINDINGS, JSONP_BINDINGS]);
var http = injector.get(Http);
http.get('foo.json'); // Would use JSONP Backend.

This is because both injectables bind the abstract ConnectionBackend class to their own specific implementation.

This should be able to be easily fixed by binding Jsonp and Http to factories that have dependencies on concrete backends instead of overriding the ConnectionBackend bindings.

@jeffbcross jeffbcross mentioned this issue Jul 29, 2015
35 tasks
0x-r4bbit added a commit to 0x-r4bbit/angular that referenced this issue Jul 30, 2015
0x-r4bbit added a commit to 0x-r4bbit/angular that referenced this issue Jul 30, 2015
0x-r4bbit added a commit to 0x-r4bbit/angular that referenced this issue Jul 30, 2015
0x-r4bbit added a commit to 0x-r4bbit/angular that referenced this issue Jul 30, 2015
0x-r4bbit added a commit to 0x-r4bbit/angular that referenced this issue Jul 30, 2015
0x-r4bbit added a commit to 0x-r4bbit/angular that referenced this issue Aug 11, 2015
0x-r4bbit added a commit to 0x-r4bbit/angular that referenced this issue Aug 14, 2015
0x-r4bbit added a commit to 0x-r4bbit/angular that referenced this issue Aug 14, 2015
0x-r4bbit added a commit to 0x-r4bbit/angular that referenced this issue Aug 14, 2015
0x-r4bbit added a commit to 0x-r4bbit/angular that referenced this issue Aug 17, 2015
@mhevery mhevery changed the title fix(http): cannot use jsonpInjectables and httpInjectables in same injector fix(http): cannot use JSON_BINDINGS and HTTP_BINDINGS in same injector Aug 20, 2015
@mhevery mhevery changed the title fix(http): cannot use JSON_BINDINGS and HTTP_BINDINGS in same injector fix(http): cannot use JSONP_BINDINGS and HTTP_BINDINGS in same injector Aug 20, 2015
jeffbcross pushed a commit to jeffbcross/angular that referenced this issue Aug 24, 2015
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants