Minesweeper port in AngularJS