Last active
October 15, 2016 14:21
-
-
Save saggiyogesh/d678b09cb4d1d577564fd3a0d36b6ab7 to your computer and use it in GitHub Desktop.
Loopback create computed props from other props.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (Customer) { | |
Customer.getter['fullname'] = function () { | |
return `this.firstName this.lastName`.trim() | |
}; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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