diff --git a/src/services/profiles.ts b/src/services/profiles.ts index f4402c8..ae6b462 100644 --- a/src/services/profiles.ts +++ b/src/services/profiles.ts @@ -9,12 +9,12 @@ export class ProfileService { fallback: string = 'assets/data/profiles.json'; epSubmitted: string = '/submitted'; epVerified: string = '/verified'; - idMap: any = { all: {}, submitted: {}, verified: {} }; + idMap: any; profiles: any; constructor(private http: Http) { - this.idMap = {}; + this.idMap = { all: {}, submitted: {}, verified: {} }; this.profiles = null; } @@ -53,6 +53,7 @@ export class ProfileService { .map(res => res.json()) .subscribe( data => { + this.idMap = this.profiles = this.profiles || {}; this.profiles[type] = data; this.profiles[type].reduce((map, profile, i) => {