Add documentation to interceptors.
This commit is contained in:
@@ -60,6 +60,13 @@
|
||||
<code>src/app/_interceptors/http-config.interceptor.ts</code>
|
||||
</p>
|
||||
|
||||
<p class="comment">
|
||||
<h3>Description</h3>
|
||||
</p>
|
||||
<p class="comment">
|
||||
<p>Intercepts and handles setting of configurations to outgoing HTTP request. </p>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
<section>
|
||||
@@ -101,10 +108,16 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="6" class="link-to-prism">src/app/_interceptors/http-config.interceptor.ts:6</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="10" class="link-to-prism">src/app/_interceptors/http-config.interceptor.ts:10</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-description"><p>Initialization of http config interceptor. </p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
@@ -136,14 +149,16 @@
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="9"
|
||||
class="link-to-prism">src/app/_interceptors/http-config.interceptor.ts:9</a></div>
|
||||
<div class="io-line">Defined in <a href="" data-line="21"
|
||||
class="link-to-prism">src/app/_interceptors/http-config.interceptor.ts:21</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-description"><p>Intercepts HTTP requests.</p>
|
||||
</div>
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
@@ -153,6 +168,7 @@
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
<td>Description</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -167,6 +183,12 @@
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<ul>
|
||||
<li>An outgoing HTTP request with an optional typed body.</li>
|
||||
</ul>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>next</td>
|
||||
@@ -179,6 +201,12 @@
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<ul>
|
||||
<li>The next HTTP handler or the outgoing request dispatcher.</li>
|
||||
</ul>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -190,7 +218,8 @@
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
|
||||
<p>The forwarded request.</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -202,14 +231,25 @@
|
||||
|
||||
|
||||
<div class="tab-pane fade tab-source-code" id="c-source">
|
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Injectable } from '@angular/core';
|
||||
import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
|
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
// Third party imports
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/** Intercepts and handles setting of configurations to outgoing HTTP request. */
|
||||
@Injectable()
|
||||
export class HttpConfigInterceptor implements HttpInterceptor {
|
||||
/** Initialization of http config interceptor. */
|
||||
constructor() {}
|
||||
|
||||
/**
|
||||
* Intercepts HTTP requests.
|
||||
*
|
||||
* @param request - An outgoing HTTP request with an optional typed body.
|
||||
* @param next - The next HTTP handler or the outgoing request dispatcher.
|
||||
* @returns The forwarded request.
|
||||
*/
|
||||
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
|
||||
// const token: string = sessionStorage.getItem(btoa('CICADA_SESSION_TOKEN'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user