Typically, in an Aurelia application, what you importing is not an instance of a Somethingclass Something. To use everything that was imported, you need an instance of this file.
import Something from 'whatever';
let something = new Something();
Aurelia Dependency Injection, , "Inversion of Control". , ( ) , , , , .
, ( , Aurelia DI). Dependency Injection , .
--- OP ---
, Something, aurelia view model, , . Something.
, Aurelia Dependency . :
import {inject} from 'aurelia-framework';
import Something from 'somewhere';
@inject(Something)
export class Foo {
constructor(something) {
this.something = something;
}
}
import Something from 'somewhere';
export class Foo {
constructor(Something) {
this.something = something;
}
}
: " , , ", : ", , ".
, , aurelia DI , . - js aurelia , , ( aurelia DI). ?
. , moment, , , Aurelia. , .