Closed victorsosa closed 5 years ago
Hi @victorsosa, unfortunately in current restangular stage I can't find a solution to add correctly typed structure. In general, it's related to the configurable property names. If you have any ideas how it can be performed I will be happy to discuss. PR's are always welcome
Hi,
I was thinking that we are missing in this API the Typescript Generics for the function that return the result object.
One example use will be:
let clients = this.restangular.all("client").getList<Client>();
This will return a list of objects type Client class; including the rectangular method on it. There is a condition that the Client class has to extent the Restangular class before made any call.
export class Client extends Restangular(){}
because get and getList are implemented in the Restangular class.
Other methods need to be changed to generics like:
This will be a nice feature to be implemented as Typescript use classes.