Closed tmichalec closed 4 years ago
Hi @tmichalec ,
Yes, you can't do postRelation for embeddable entity. I'll see what I can do to make it work.
@tmichalec , I've added support for embeddable entities in 1.0.18 version that already available in npm.
After update hal-client you need only extend CartItem
from EmbeddedResource
that adds ability to do links operations like getRealtion
on this model class for more information see here and here:
export class Cart extends Resource {
items: CartItem[];
}
export class Product extends Resource {
name: string;
}
export class CartItem extends EmbeddedResource {
product: Product;
}
Hello,
is it possible to use getRelation for embedded object in entity?
SERVER:
CLIENT:
GET /cart/1 looks like
show ERROR TypeError: cart.items[0].getRelation is not a function
Or is there some workaround to do this?