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
So the wheel types collection has quite some different functions as the wheels collection on the car, so when we try to map this with extend model, we'll end up with something in line of this:
Currently this will bind the detachFromCar function to all objects returned from both api's (and the swapTireType function is never bound)... Of course you could say, change the api route to wheelTypes instead of wheels, but that's not always an option.
My suggestion would be that the extendModel (/addElementTransformer) would also be to determine the path to model being extended. The way I see this, this can be done 2 ways:
So, what are your thoughts? Is there another way, if not, what would be a potential solution? I might be able to make a change and create a pull request if we can decide on a solution.
The text was updated successfully, but these errors were encountered:
In our current setup we use extendModel to add additional functionality to the returned restangular objects.
Our problem is that the typeTransformers registery is a simple key/value storage. So route X has transformer Y.
Example, say we have to consume an api:
So the wheel types collection has quite some different functions as the wheels collection on the car, so when we try to map this with extend model, we'll end up with something in line of this:
Currently this will bind the detachFromCar function to all objects returned from both api's (and the swapTireType function is never bound)... Of course you could say, change the api route to wheelTypes instead of wheels, but that's not always an option.
My suggestion would be that the extendModel (/addElementTransformer) would also be to determine the path to model being extended. The way I see this, this can be done 2 ways:
So, what are your thoughts? Is there another way, if not, what would be a potential solution? I might be able to make a change and create a pull request if we can decide on a solution.
The text was updated successfully, but these errors were encountered: