full address

This commit is contained in:
Kyle Spearrin 2019-01-16 13:51:14 -05:00
parent 80c0da766e
commit cbcf0adad5
1 changed files with 19 additions and 0 deletions

View File

@ -2,6 +2,8 @@ import { View } from './view';
import { Identity } from '../domain/identity';
import { Utils } from '../../misc/utils';
export class IdentityView implements View {
title: string = null;
middleName: string;
@ -83,4 +85,21 @@ export class IdentityView implements View {
return null;
}
get fullAddress(): string {
let address = this.address1;
if (Utils.isNullOrWhitespace(this.address2)) {
if (Utils.isNullOrWhitespace(address)) {
address += ', ';
}
address += this.address2;
}
if (Utils.isNullOrWhitespace(this.address3)) {
if (Utils.isNullOrWhitespace(address)) {
address += ', ';
}
address += this.address3;
}
return address;
}
}