I am new to Angular. The following code prints the right user email ("my_email@domain.com"
) but in the javascript alert it shows "{{user_name}}"
instead of "my_email@domain.com"
.
<div ng-app="app" ng-controller="MyController" id="id123">
{{user_name}}
</div>
<script> var to_print=document.getElementById('id123').innerText; alert(to_print) </script>
Thank you for your help.