The button click displays a pop-up but it does not show the dynamic value. My variable $scope.errorLog changes dynamically. Can I know where I am going wrong? The initial value for $scope.errorLog is "hello", it should change to world.
I have a controller as follows:
function service($http, $scope, $interval) {
$scope.myfunction = function(arg1, arg2, arg3, arg4) {
//Based on some of the variable values in my functions here, I need to
//display these variable values in a modal view in my html. The modal
//should appear on the click of a button.
//End of my functions to set the variable values I should display.
var err = document.getElementById("showErrors");
err.onclick = function(){
$scope.errorLog = "world"; // console.log prints the updated value
var modal = document.getElementById('showLogs');
modal.style.display = "block";
document.getElementById('logsOkButton').onclick = function() {
modal.style.display = "none";
}
}
}
}
My html looks like this for this dialog box :
<div id="showLogs" class="modal">
<div class="infobox">
<div class="container" id="logs">
{{ errorLog }}
</div>
<br/>
<div class="okbutton"><button id="logsOkButton">OK</button></div>
</div>
</div>