UNPKG

@alihbuzaid/ember-ui

Version:

Fleetbase UI provides all the interface components, helpers, services and utilities for building a Fleetbase extension into the Console.

22 lines (17 loc) 532 B
import Component from '@glimmer/component'; import { action } from '@ember/object'; import { isBlank } from '@ember/utils'; export default class ImageComponent extends Component { @action setupComponent(element) { const { fallbackSrc } = this.args; if (isBlank(element.src) && fallbackSrc) { element.src = fallbackSrc; } } @action onError(event) { const { fallbackSrc } = this.args; if (fallbackSrc) { event.target.src = fallbackSrc; } } }