// Aurelia
import {
  bindable,
  bindingMode
} from 'aurelia-framework';

import icons from 'configs/icons';

export class SvgIcon {
  @bindable({ defaultBindingMode: bindingMode.oneWay }) iconId;

  attached () {
    const id = this.iconId.toUpperCase().replace('-', '_');
    this.icon = icons[id] ? icons[id] : icons.WARNING;
  }
}

// Aurelia
import {
  bindable,
  bindingMode
} from 'aurelia-framework';

import icons from 'configs/icons';

export class SvgIcon {
  @bindable({ defaultBindingMode: bindingMode.oneWay }) iconId;

  constructor () {
    this.icon = {
      viewBox: '0 0 16 16',
      svg: ''
    };
  }

  attached () {
    const id = this.iconId.toUpperCase().replace('-', '_');
    this.icon = icons[id] ? icons[id] : icons.WARNING;
  }
}

Set default values to avoid initial binding errors.
Set default values to avoid initial binding errors.
