Folks, I'm in the middle of "learning by doing" in Angular 6 & 7, and I came across this issue a number of times.
Imagine I have a class/interface/type - e.g. Person - with a few properties, that are returned by a Web API call - something like this:
export interface Person {
FirstName: string;
LastName: string;
JobTitle: string;
// so other properties - not relevant to this question
}
What I'd like to be able to is show the full name (e.g. "FirstName + [Space] + LastName") in e.g. an Angular grid (AG-Grid) or someplace else - where I cannot use a concat expression or anything, but I need to refer to a single property on the class/interface/type.
In C#, I would just create a property
string FullName { get { return $"{FirstName} {LastName}"; } }
and be done with it - but how can I do this in Typescript?? From what I've been reading and researching, this seems to be unsupported - really?!?!!? How can that be??? Seems like such a simple and often-used operation - what's the reason this doesn't exist in Typescript?? Or does it exist - and I just haven't found the way to do this in TS?