Within my class called userName, I have defined properties that form a model when casting from json. Additionally, this class includes a simple function that returns the full Name:
export class userName {
firstName: string;
lastName: string;
get fullName() {
return `${this.firstName} ${this.LastName}`
}
In my service, I have a method that retrieves a collection of users:
getUsers() : Observable<userName[]>
{
return this.http.get<userName[]>(<path>);
}
After retrieving the collection from the service in the component, I want to display the firstName + LastName together like the fullName property does, even though it is not returned by the service. Is there a way to achieve this without creating a custom extension?