You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -126,24 +126,24 @@ export class TestComponent implements OnInit {
126
126
### Description
127
127
Available annotations:
128
128
1) Request methods
129
-
@GET, @POST, @PUT, @DELETE, @OPTIONS, @HEAD, @PATCH - marks methods implementing the corresponding requests
129
+
@GET, @POST, @PUT, @DELETE, @OPTIONS, @HEAD, @PATCH - marks methods implementing the corresponding requests
130
130
2) Added settings
131
-
-@Path - set path of url for request. Combined class @Path annotation value and current method @Path. Path params passed with ":". For example @Path('/someurl/:someParam')
132
-
-@Headers - set headers for request (if annotate class, then all class methods getting this headers. method Headers merge with class Headers)
133
-
-@Produces - setting expected response type. By default Reponse transformed by .json() method
134
-
-@Observes - setting http observes.
135
-
3) Parameters
136
-
-@PathParam (or @Path) - pass current parameter by name to collected url. Example: someFunc(@PathParam('id') itemId: number) {}
137
-
-@Body - pass body object into request. Ex.: someMethod(@Body bodyObject: any){}
138
-
-@QueryParam - pass single query parameters into request. Ex.: someMethod(@QueryParam('a') a: any, @QueryParam('b') b: any) {}. someMethod(1, 2) -> ..requested_url..?a=1&b=2
139
-
-@QueryParams - pass object with few query params. Ex.: someMethod(@QueryParams queryObj: any){}. someMethod({x: 1, y: 2, z: 3}) -> ..requested_url..?x=1&y=2&z=3
140
-
-@ResponseObservable - specify in witch function params, the response observable will be added. Ex.: someMethod(@ResponseObservable res: Observable<any> = undefined){ /* transform request */ return res; }. need to initialise as undefined to pass compile error, and return a response.
141
-
142
-
143
-
#### Transform response with all rxjs function
144
-
145
-
By adding the parameters @ResponseObservable you can specify, where add the observable response,
146
-
131
+
-@Path - set path of url for request. Combined class @Path annotation value and current method @Path. Path params passed with ":". For example @Path('/someurl/:someParam')
132
+
-@Headers - set headers for request (if annotate class, then all class methods getting this headers. method Headers merge with class Headers)
133
+
-@Produces - setting expected response type. By default Reponse transformed by .json() method
134
+
-@Observes - setting http observes.
135
+
3) Parameters
136
+
-@PathParam (or @Path) - pass current parameter by name to collected url. Example: someFunc(@PathParam('id') itemId: number) {}
137
+
-@Body - pass body object into request. Ex.: someMethod(@Body bodyObject: any){}
138
+
-@QueryParam - pass single query parameters into request. Ex.: someMethod(@QueryParam('a') a: any, @QueryParam('b') b: any) {}. someMethod(1, 2) -> ..requested_url..?a=1&b=2
139
+
-@QueryParams - pass object with few query params. Ex.: someMethod(@QueryParams queryObj: any){}. someMethod({x: 1, y: 2, z: 3}) -> ..requested_url..?x=1&y=2&z=3
140
+
-@ResponseObservable - specify in witch function params, the response observable will be added. Ex.: someMethod(@ResponseObservable res: Observable<any> = undefined){ /* transform request */ return res; }. need to initialise as undefined to pass compile error, and return a response.
141
+
142
+
143
+
#### Transform response with all rxjs function
144
+
145
+
By adding the parameters @ResponseObservable you can specify, where add the observable response,
146
+
147
147
```typescript
148
148
149
149
@GET
@@ -157,13 +157,13 @@ Available annotations:
157
157
```
158
158
### Mocks calls
159
159
160
-
To have a feature to enable mocks api. When enabled, will call directly the function rather than call the http request.
160
+
To have a feature to enable mocks api. When enabled, will call directly the function rather than call the http request.
define your mocks by return a fake observable, with your mock data.
177
+
define your mocks by return a fake observable, with your mock data.
178
178
179
179
```typescript
180
180
@GET
@@ -184,25 +184,33 @@ define your mocks by return a fake observable, with your mock data.
184
184
}
185
185
```
186
186
187
-
### Change logs
187
+
### Change logs
188
188
189
189
0.6.x
190
190
191
-
-> updates to latest versions of Angular
192
-
-> Rename library to ngx-http-annotations
193
-
-> add @ResponseObservable to transform response.
194
-
195
-
0.6.2 et 0.6.3
191
+
-> updates to the latest versions of Angular
192
+
-> Rename library to ngx-http-annotations
193
+
-> add @ResponseObservable to transform response.
196
194
197
-
-> update to build library with angular, to avoid error when build in --prod
195
+
0.6.2 et 0.6.3
198
196
199
-
0.7.x
197
+
-> update to build the library with angular, to avoid error when build in --prod
200
198
201
-
-> Add a mock feature.
202
-
-> Update dependency to latest
203
-
199
+
0.7.x
204
200
205
-
### Source and issues
201
+
-> Add a mock feature.
202
+
-> Update dependency to latest
206
203
207
-
Code are located in github : https://github.com/manudss/ngx-http-annotations
204
+
0.7.3
205
+
-> Add delay: Add a beta feature, to add a delay to all requests, or have a function that returns this delay. This could be useful, in the mock feature. By default, all mock, will have a default delay. But could be also added without mock, to simulate long request.
206
+
-> Use all httpClient methods rather than use request method, use the corresponding method (get, put, delete ...). In order, to avoid issue with request method that throw a first empty error.
207
+
-> Update dependencies: Update to version 13 of Angular.
208
+
209
+
0.8.0
210
+
-> Updates to Angular 16, and compile libs to ivy
211
+
-> change to nx workspace
212
+
-> Add unit tests
208
213
214
+
### Source and issues
215
+
216
+
Code are located in github : https://github.com/manudss/ngx-http-annotations
0 commit comments