ryanhelms1 icon

Aurelia Custom Element Base Class

ryanhelms1 | PRO | 11/07/17 02:09:25 AM UTC | 0 ⭐ | 285 👁️ | Never ⏰ | []
JavaScript |

650 B

|

None

|

0 👍

/

0 👎

import { bindable } from 'aurelia-framework';
import { Container } from 'aurelia-dependency-injection';
import { EventAggregator } from 'aurelia-event-aggregator';
import { DataStore } from './../../../common/services/data-stores/data-store';
import { StorageService } from './../../../common/services/storage-service';
 
export class BaseCustomElement {
  @bindable cache;
  @bindable eventAggregator;
  @bindable dataStore;
 
  constructor() {
    let container = Container.instance;
 
    this.eventAggregator = container.get(EventAggregator);
    this.cache = container.get(StorageService);
    this.dataStore = container.get(DataStore);
  }
}

Comments