Attempting to utilize my scope within a compile... I aim for a scenario where upon clicking a button, a div is generated containing the round number.
main.controller('fightController', function($scope, $http, Services, $compile) {
$scope.doAFight = function(playerHab, monsterHab) {
Services.getFight(playerHab, monsterHab)
.success(function(data){
$scope.fight = data;
$scope.round = 0;
});
};
$scope.addRound = function() {
angular.element(document.getElementById('boiteCombat')).append($compile("
<div class=rondeCombat>
<div class=numRonde> Ronde " + $scope.round + " </div>
</div>
")($scope));
};
});
Encountering an error indicating that the attempted action is unauthorized...