-
Notifications
You must be signed in to change notification settings - Fork 674
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ColdMoonMao/master
docs(net.md): add english version
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
order: 4 | ||
title: | ||
en-US: Network | ||
zh-CN: 网络请求 | ||
type: Basic | ||
--- | ||
|
||
ng-alain There are two default processings for any network request。 | ||
|
||
## 1、Expand HttpClient | ||
|
||
`@delon/theme` Contains a class called [_HttpClient](//github.com/cipchk/delon/blob/master/src/core/theme/services/http/http.client.ts) ,The essence is calling Angular's `HttpClient`,just wrapping add `loading`。 | ||
|
||
We know that ng-zorro-antd is flooded with a large number of `nzLoading` attributes, which allows for a more user-friendly loading of web requests so that we do not have to maintain a` loadind` variable on every business page。 | ||
|
||
Of course, not only that,`_HttpClient` Also unified processing of all time data format for the timestamp, which for the front-end state to ensure the consistency of the data has a good effect。 | ||
|
||
## 2、The default interceptor | ||
|
||
The benefits of interceptors are self-evident;Uniform handling server request prefix,Uniform add `token` for each request,and so on。 | ||
|
||
The `src / app / core / net / default.interceptor.ts` file provides an implementation of the interceptor, you can tailor to your own needs。 |
File renamed without changes.