Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
brianParcel committed Feb 27, 2018
1 parent b7ad68b commit 23c9cc8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/app/models/user.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ export class User extends Model {
if(name){
let split = name.split(' ');
this.first = split[0];
this.last = split[1];
if(split[1]) this.last = split[1];
}else{
this.first = '';
this.last = '';
}
}

get full_name(){
let full_name;
let full_name = '';
if(this.first) full_name = `${this.first}`;
if(this.last) full_name = `${full_name} ${this.last}`;
return full_name;
Expand Down

0 comments on commit 23c9cc8

Please sign in to comment.