added input for custom images

This commit is contained in:
Vito Albano
2016-11-08 16:55:23 +00:00
parent 5dd82dca25
commit 3c3306962d
2 changed files with 15 additions and 5 deletions

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, Input } from '@angular/core';
import { EcmUserModel } from './../models/ecm-user.model';
import { BpmUserModel } from './../models/bpm-user.model';
import { EcmUserService } from './../services/ecm-user.service';
@@ -31,6 +31,15 @@ import { AlfrescoSettingsService, AlfrescoTranslationService } from 'ng2-alfresc
export class UserInfoComponent implements OnInit {
@Input()
ecmBackgroundImage: string;
@Input()
bpmBackgroundImage: string;
@Input()
fallBackThumbnailImage: string;
private baseComponentPath = module.id.replace('components/user-info.component.js', '');
ecmUser: EcmUserModel;
@@ -72,7 +81,7 @@ export class UserInfoComponent implements OnInit {
onImageLoadingError(event) {
if (event) {
let element = <any> event.target;
element.src = this.anonymousImageUrl;
element.src = this.fallBackThumbnailImage || this.anonymousImageUrl;
}
}