Skip to content

Instantly share code, notes, and snippets.

@saggiyogesh
Last active October 15, 2016 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saggiyogesh/d678b09cb4d1d577564fd3a0d36b6ab7 to your computer and use it in GitHub Desktop.
Save saggiyogesh/d678b09cb4d1d577564fd3a0d36b6ab7 to your computer and use it in GitHub Desktop.
Loopback create computed props from other props.
module.exports = function (Customer) {
Customer.getter['fullname'] = function () {
return `this.firstName this.lastName`.trim()
};
};
{
"name": "Customer",
"plural": "Customers",
"base": "PersistedModel",
"properties": {
"fullName": "string",
"lastName": "string",
"firstName": "string"
},
"validations": [],
"relations": {},
"acls": [],
"methods": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment