-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Closed
Labels
featureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issues
Description
In order to achieve a simple experience with the new http library, and to somewhat match the API of AngularJS 1.x, the http service was implemented as an injectable function as the only way to use. There are a few usability costs with the current approach.
- An interface,
IHttp, must be provided and used alongsideHttpinjection in order to provide type information:constructor(@Inject(Http) http:IHttp) - It would be nice to have shorthand methods, like .get(), .post(), etc to reduce boilerplate. These could be added onto the http function, but...
- Decorating the http factory with these methods would cause TypeScript to not know about the additional methods.
New Design:
Keep current workflow as an option, but require injecting HttpFactory instead of Http, and make Http an injectable class with methods: request, get, put, delete, post.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureLabel used to distinguish feature request from other issuesLabel used to distinguish feature request from other issues