Configuring Event Aggregator

The Event Aggregator class is not hard to understand. Incredibly, it just has three exposed methods. Like any other Aurelia module, you just need to import and inject it into your view model before using it:

import { inject } from 'aurelia-framework';
import { EventAggregator } from 'aurelia-event-aggregator';

@inject(EventAggregator)
export class ExampleClass {
    constructor(EventAggregator) {
        this.ea = EventAggregator;
    }
}

Now, let's explore the Event Aggregator methods in detail.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.132.33