-
Notifications
You must be signed in to change notification settings - Fork 357
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
Feature/http helpers #25
Conversation
@Injectable() | ||
export class CustomRESTService extends RESTService<any> { | ||
|
||
constructor(private _http: Http) { // or constructor(private _http: HttpInterceptorService) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this suppose to be commented? i think what you have is valid but maybe having it on its own line would be more clear:
constructor(private _http: Http) {
/* or constructor(private _http: HttpInterceptorService) { */
or
constructor(private _http: Http) {
/// or constructor(private _http: HttpInterceptorService) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is intentional I think there should be a note explaining the use cases or just pick one.
On a side note, is an inline comment any better?
constructor(private _http: HTTP /* or HttpInterceptorService */) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, maybe just having it inline works fine, ill change it. 👍 and add a note.
…or constructor restservice
* added docs content, routing and initial examples * cleaned up unused class props * fixed anguler.json test styles references * removed unused css overide for mininav * moved theme-dark css under one theme-dark block * removed unused npath and data/scatter.ts * feat(): remove icon property frmo interface since it doesnt belong in echarts also removed unused imports, styles and commented code * chore(): upgrade Covalent & Angular to get sidenav containerAutosize * feat(mininav): streamline mininav
* added docs content, routing and initial examples * cleaned up unused class props * fixed anguler.json test styles references * removed unused css overide for mininav * moved theme-dark css under one theme-dark block * removed unused npath and data/scatter.ts * feat(): remove icon property frmo interface since it doesnt belong in echarts also removed unused imports, styles and commented code * chore(): upgrade Covalent & Angular to get sidenav containerAutosize * feat(mininav): streamline mininav
Description
Http helper module, including interceptor wrapper.
#19
What's included?
http
moduleHttpInterceptorService
Service provided with methods that wrap the ng2 [Http] service and provide an easier experience for interceptor implementation.
To add a desired interceptor, it needs to implement the [IHttpInterceptor] interface.
Every method is optional, so you can just implement the ones that are needed.
Example for usage:
Also, you need to bootstrap the interceptor providers
After that, just inject [HttpInterceptorService] and use it for your requests.
Properties:
Test Steps
components
->http
Screenshots