angular2-jsonapi
angular2-jsonapi copied to clipboard
rename the id field
It looks like that all models must have an id field called 'id' .What if in my database the unique key identifier of objects is not called id?Is there a way to override the name of the id field?
@lbertidrwolf Hi, you are right that all models MUST have 'id'. This comes from JSON:API Specification. So if You are using different name than 'id', you need to create transformer on your BackEnd side where you transform 'id' to 'other property' before saving to database and back before you send data back to FrontEnd.