Chess Board Directive for AngularJS based on chessboard.js
- Multichess (Demo Application) - http://multichess.github.io
- Examples - http://theborakompanioni.github.io/angular-chess/#/examples
Install with bower
bower install theborakompanioni/angular-chessboard --save
Add the following tags to your project
<link rel="stylesheet" href="/chessboard.js/css/chessboard.css"/>
<script src="/chessboard.js/js/chessboard.js"></script>
<script src="/angular-chessboard/dist/angular-chessboard.min.js"></script>You can configure the default behaviour of all settings. See chessboard.js Documentation for all values an their purpose.
angular.module('myModule', ['nywton.chessboard']);angular.config(['nywtonChessboardConfigProvider', function nywtonChessConfigConfig(chessboardProvider) {
chessboardProvider.draggable(true)
.position('start')
.pieceTheme('/chessboard.js/img/chesspieces/wikipedia/{piece}.png');
}])The default settings will create a board with draggable pieces in starting position:
<nywton-chessboard></nywton-chessboard>Create an empty board:
<nywton-chessboard board="boardA" data-position="'empty'"></nywton-chessboard>Create a board with non-draggable pieces in starting position:
<nywton-chessboard board="boardB" data-draggable="false"></nywton-chessboard>An auto resizeable board:
<nywton-chessboard board="boardC"
data-nywton-chessboard-autoresize
></nywton-chessboard>A resizeable board initialized with "Ruy Lopez" (or Spanish Opening):
<nywton-chessboard board="boardD"
data-nywton-chessboard-autoresize
data-nywton-position-ruy-lopez
></nywton-chessboard>- Issue Tracker: https://github.com/theborakompanioni/angular-chessboard/issues
- Source Code: https://github.com/theborakompanioni/angular-chessboard
git clone https://github.com/theborakompanioni/angular-chessboard.git
npm install && bower install
grunt
grunt test
The project is licensed under the MIT license. See LICENSE for details.
