Angular 6+ HttpClient provider for Deus Legem Creation System
npm install @dlcs/provider-angular-http!status

Resource provider for Angular HttpClient.
| Name | Default value | Usage |
|-|:-|:-|
| ``server.address` | `''` | Default server address from `remote` protocol |`
| server.responseType` | `'json'` | Default response type |`
| server.contentType` | `'application/json'` | Default content type |`
| assets.address` | `''` | Default address from `assets` protocol |
* `remote` for access default server defined in Configuration.`
* assets` for access staic files defined in Configuration.`
* http` for access http address.`
* https` for access https address.
| Name | Default value | Description |
|-|:-|:-|
| `responseType` | Set by configuration | Respnse type |`
| contentType` | Set by configuration | Content type |`
| method` | `XHRMethod.GET` | Request http method. |`
| headers` | `undefined` | Extra headers |`
| querys` | `undefined` | URL query parameters |`
| body` | `undefined` | Request body, only affects POST/PUT/PATCH |`
| timeout` | `undefined` | Request timeout, do not set this value or set to `0` to disable timeout. |
Structure defined as AngularHttpRequestParams.
| Protocol | Asynchronized | Synchronized | Request | Submit | Delete |
|-|:-:|:-:|:-:|:-:|:-:|
| remote | √ | × | √ | √ | √ |
| assets | √ | × | √ | × | × |
| http | √ | × | √ | √ | √ |
| https | √ | × | √ | √ | √ |
| Timepoint | Data structure | Data description | Request method |
|-|:-|:-|:-|
| BeforeSend | `AngularHttpRequestData` | Request parameters | Request/Submit/Delete |`
| AfterSent | Observable` | Response from HttpClient | Request/Submit/Delete |
See AngularHttpRequestData's definition.
`typescripthttp://www.google.com
resourceManager.registerProtocol(new AngularHttpProtocol(this.httpClient)); // Angular HttpClient from Angular DI
// Request data
resourceManager.request.to().tag('google').send();remote:///test.txt
// Request using default server
http.config.server.address = 'http://www.a.org';
resourceManager.request.to().tag('test').send();assets:///test.txt
// Request static file
http.config.assets.address = '/assets';
resourceManager.request.to().tag('test_local').send();http://www.test.org
// POST data
resourceManager.request.to().param({ method: XHRMethod.POST }).tag('google').send();``