Skip to content

Latest commit

 

History

History
48 lines (38 loc) · 898 Bytes

get-started.md

File metadata and controls

48 lines (38 loc) · 898 Bytes
layout title nav_order permalink has_children
default
Get Started
2
/get-started
true

Get Started

npm i bcx-aurelia-dnd

Or

yarn add bcx-aurelia-dnd

Use inside Aurelia app

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.