Skip to content

Angular 2 module wrapping chessboardjs library as a component

License

Notifications You must be signed in to change notification settings

8manos/ng2-chessboard

 
 

Repository files navigation

Angular 2 Chessboard Component

Component wrapping the chessboardJS library. See online documentation.

For more information about the wrapped library, and more details about parameters, methods and events, see ChessboardJS official documentation

Installation

Using NPM

  npm i ng2-chessboard --save

Usage

Basic

<ng2-chessboard [(position)]="position"></ng2-chessboard>

Extended

<ng2-chessboard #board
  [(position)]="position"
  [orientation]="orientation"
  [showNotation]="showNotation"
  [draggable]="draggable"
  [animation]="animation"
  (change)="onChange($event)"
  (dragStart)="onDragStart($event)"
  (dragMove)="onDragMove($event)"
  (drop)="onDrop($event)"
  (snapbackEnd)="onSnapbackEnd($event)"
  (moveEnd)="onMoveEnd($event)">
</ng2-chessboard>

Variables

  • Input()/Output() position (String or Object)
  • Input() orientation (Boolean)
  • Input() showNotation (Boolean)
  • Input() draggable (Boolean)
  • Input() dropOffBoard (String)
  • Input() pieceTheme (String or Function)
  • Input() moveSpeed (Number)
  • Input() snapbackSpeed (Number)
  • Input() snapSpeed (Number)
  • Input() sparePieces (Boolean)

Methods

  • clear()
  • move(String)

Events

  • Output() change
  • Output() dragStart
  • Output() dragMove
  • Output() drop
  • Output() snapbackEnd
  • Output() moveEnd

About

Angular 2 module wrapping chessboardjs library as a component

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 61.2%
  • HTML 29.2%
  • JavaScript 7.0%
  • CSS 2.6%