Skip to content

AdminImage (Directive)

You can use the admin image module for user avatar together with gravatar.com and for project logos.

The feature of this module ist the error handling: In case of a 404 error of the image source (img src) the module shows a default image-not-found image. Or a default user profile icon (type=user), or a default project icon (type=project).

Parameters

Name Type Description
image string source of the image:
- in case of user (gr)avatar it's the e-mail address,
- in case of project logo it's the image url
type string type of image; you can use it with:
- project
- user

Examples

User Avatar

HTML file

// Default user profile image
<img kuiAdminImage [image]="imgDefaultUser" [type]="'user'" />

// Avatar example: 'salsah' user
<img kuiAdminImage [image]="imgSalsahUser" [type]="'user'" />

// User image on error
<img kuiAdminImage [image]="null" [type]="'user'" />

// Default error image
<img kuiAdminImage [image]="'null'" />

Typescript file

imgDefaultUser: string = 'root@example.com';
imgSalsahUser: string = 'salsah@dasch.ch';

User avatars


HTML file

// Default project image
<img kuiAdminImage [image]="imgDefaultProject" [type]="'project'" />

// Logo example: 'dasch' project
<img kuiAdminImage [image]="imgDaschProject" [type]="'project'" />

Typescript file

imgDefaultProject: string = undefined;
imgDaschProject: string = 'http://dasch.swiss/content/images/2017/11/DaSCH_Logo_RGB.png';

Default project logos