Skip to content

Commit

Permalink
add display card in hand
Browse files Browse the repository at this point in the history
  • Loading branch information
clyde30 committed Feb 10, 2016
1 parent d3e5314 commit 093f8d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
13 changes: 7 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,20 @@ <h1>Testing Card Dealer</h1>
<button ng-click = "ctrl.dealOne()">
Deal Card </button> </br>

<!-- <input type = "text" -->
<!-- ng-model = "numCards" -->
<!-- placeholder = "Enter number of cards to deal"> -->
<button ng-click = "ctrl.dealHand()">
Deal Hand</button> </br>

<h3 ng-bind = "ctrl.showOneCard"></h3>

<div>
<img ng-src = "src/images/cards/{{ctrl.image}}">
</div>

<div ng-repeat="card in ctrl.hand">
<img ng-src = "src/images/cards/{{ctrl.image}}">
</div>
<div>
<span ng-repeat = "card in ctrl.hand">
<img ng-src = "src/images/cards/{{card.image}}">
</span>
</div>

<script src="bower_components/jQuery/dist/jquery.min.js"></script>
<script type="text/javascript" src="src/js/cardImage.js"></script>
Expand Down
6 changes: 2 additions & 4 deletions src/js/dealerApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ angular.module('dealApp', [])
};

self.dealHand = function () {
hand = dealHand(5);
self.showHand = hand.buildCard;
self.image = pickCardImage(card);
console.log(hand);
self.hand = dealHand(5);
console.log(self.hand);
};

self.shuffle = function () {
Expand Down

0 comments on commit 093f8d8

Please sign in to comment.