Awesome
angular-chessboard
Chess Board Directive for AngularJS based on chessboard.js
Examples
- Multichess (Demo Application) - http://multichess.github.io
- Examples - http://theborakompanioni.github.io/angular-chess/#/examples
Download
Bower
Install with bower
bower install theborakompanioni/angular-chessboard --save
Github
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>
Usage
Configuration
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');
}])
Directive
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>
Contribute
- Issue Tracker: https://github.com/theborakompanioni/angular-chessboard/issues
- Source Code: https://github.com/theborakompanioni/angular-chessboard
Clone Repository
git clone https://github.com/theborakompanioni/angular-chessboard.git
Install dependencies
npm install && bower install
Build project
grunt
Run tests
grunt test
License
The project is licensed under the MIT license. See LICENSE for details.