I just created a plunkr example at http://plnkr.co/8gJdFrEiplMO7FzOq9Sm
My question is, why does my playerHtml directive not getting any output?
My player directive looks like this
app.directive('playerHtml', function() {
return {
restrict: 'A',
scope: {
player: '=',
bold: '=',
wintype: '='
},
templateUrl: 'player.html'
}
});
And the template
<span ng-if="bold == 1" class="playername winner">{{ player.name }} - {{ player.email }} - {{ wintype }}</span>
<span ng-if="bold == 2" class="playername loser">{{ player.name }} - {{ player.email }} - {{ wintype }}</span>
And the call to the directive
<span ng-if="game.winner == 1" player-html player="{{ game.player1 }}" bold="1" wintype="{{ game.wintype }}"></span>
<span ng-if="game.winner != 1" player-html player="{{ game.player1 }}" bold="0" wintype="{{ game.wintype }}"></span>
<span ng-if="game.winner == 2" player-html player="{{ game.player2 }}" bold="1" wintype="{{ game.wintype }}"></span>
<span ng-if="game.winner != 2" player-html player="{{ game.player2 }}" bold="0" wintype="{{ game.wintype }}"></span>