angular2-jsonapi icon indicating copy to clipboard operation
angular2-jsonapi copied to clipboard

Questions about relationships

Open navy1978 opened this issue 5 years ago • 1 comments

Hi, Not clear how to work with relationships and jsonapi2angular library.

First question is: Are BelongsTo and HasMany mandatory for all relationships?

Thank you

navy1978 avatar Jan 26 '20 08:01 navy1978

Yes, if you want to indicate, that an attribute in your model is a relationship, you should either use the @BelongsTo or @HasMany decorator (depending on the relationship). For OneToOne relations you can check this comment

hpawe01 avatar Feb 20 '20 14:02 hpawe01