layout | title | nav_order | permalink | has_children |
---|---|---|---|---|
default |
Get Started |
2 |
/get-started |
true |
npm i bcx-aurelia-dnd
Or
yarn add bcx-aurelia-dnd
There is a single class DndService
provided by bcx-aurelia-dnd
. Inject it to your component.
ESNext
import {inject} from 'aurelia-framework';
import {DndService} from 'bcx-aurelia-dnd';
@inject(DndService)
export class YourComponent {
constructor(dndService) {
this.dndService = dndService;
}
}
TypeScript
import {autoinject} from 'aurelia-framework';
import {DndService} from 'bcx-aurelia-dnd';
@autoinject
export class YourComponent {
constructor(public dndService: DndService) {}
}
Here we rely on default behaviour of Aurelia DI (dependency injection). Aurelia DI creates a singleton
dndService
instance for all components to share.