I want a property value to depend on another inside the same interface in Angular 2+. The goal is to avoid calling the same function every time I use this class inside my app.
Something like this:
export interface PersonItem {
_id?: number;
name: string;
lastName: string;
fullName: getFullName(this.name, this.lastName)
}
function getFullName(name, surname) {
return (name + ' ' + surname);
}