Reputation: 2175
I use the EventAggregator in several places in my app and everything works fine. However I’m having trouble injecting it into one of my classes. When the class constructor is called, the EventAggregator argument is undefined.
import {EventAggregator} from 'aurelia-event-aggregator';
import {inject} from 'aurelia-framework';
@inject(EventAggregator)
export class Test {
constructor(eventAggregator) {
debugger;
this.eventAggregator = eventAggregator;
}
}
When stopping at the debugger;
line, the constructor’s eventAggregator argument is undefined.
This looks just like what I have done to use EventAggregator in many other classes, so what could be the issue?
Upvotes: 0
Views: 327
Reputation: 26406
I think this has to do with forks (multiple version of the same package installed).
config.js
file and delete everything inside the map: {
node. For example- all this. jspm install
. jspm inspect --forks
jspm install aurelia-_______
for each aurelia item listed in your package.jsonIn fact- you may want to skip right to step 4- this will ensure you get the latest, which is now 1.0.0 (RTM) version of aurelia.
Upvotes: 1