Releases: manudss/ngx-http-annotations
v0.8.0
v0.8.0-beta.1
Make it works for angular 16, with compile with Ivy.
Use nx of this.
Add unit test for this.
v0.7.4-Beta.2 : migrate to nx workspace + update to angular 14
This is a technical release, to migrate to nx, and to angular 14.
Version 0.7.4-beta.1
V0.7.4 - Beta Pre-release
Fix error in last versin 0.7.3
Fix incorrect call for post / put /patch from 7.3.0
Bug introducted in last versions, when changing call from request to specific call method. But body must be given in an other parameters.
Version 0.7.3-beta.2 : Add delay (beta) + use specific httpClient method + update dependencies
Pre-release
Add delay : Add a beta feature, to add a delay to all request, or had a function that return 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.
Use all httpClient method rather than use request method, use corresponding method (get, put, delete ...). In order, to avoid issue with request method that throw a first empty error.
Update dependencies : Update to version 13 of Angular.
Version 0.7.0 RC
-> Add a mock feature.
Mocks calls
To have a feature to enable mocks api. When enabled, will call directly the function rather than call the http request.
To enable Mocks : in a module provider use this :
providers: [{ provide: HTTP_ANNOTATIONS_USE_MOCKS, useValue: true }]
You can specify a boolean value, or have a specific function, that will be used to know if the apps will use mock. This could help you to define mock only for specific call.
providers: [{ provide: HTTP_ANNOTATIONS_USE_MOCKS, useValue: (url, requestType, params, args): boolean => {
console.log('useMock : ', url, requestType, params, args);
return requestType === 'Get' ? true : false;
} }]
define your mocks by return a fake observable, with your mock data.
@GET
@Path('posts/:id')
public getPost(@PathParam('id') id: number): Observable<any> {
return of([{id: id, title: 'mock true'}]);
}
Version 0.6.3
update to build library with angular, to avoid error when build in --prod