I am trying to display the clicked_user to the chat window when clicked. But this value is never updated on the chat window even though I see it in console.
Controller code snippet -
$(document).on('click', '.chatwin', function (e)
{
$scope.clicked_user = $(e.target).text();
console.log("USER "+ $scope.clicked_user);
$('#chat_window_1').show();
});
HTML Code
<div class="popup-head">
<div class="popup-head-left pull-left" ><img src="assets/images/AshaLogo.jpg" alt="User Image" >{{clicked_user}}</div>
<div class="popup-head-right pull-right" style="text-align: right;"><div id="circle_green"></div></div>
</div>
Another observation is that if I initialise this value outside the function e.g as below it works . Can you let me know what am i doing wrong here.
Controller code
$scope.clicked_user =“DUMMY”
$(document).on('click', '.chatwin', function (e) {
//$(this).parent().parent().parent().parent().remove();
$scope.clicked_user = $(e.target).text();
console.log("USER "+ $scope.clicked_user);
$('#chat_window_1').show();
});