I am new to Angular. The following code prints the right user email ("[email protected]"
) but in the javascript alert it shows "{{user_name}}"
instead of "[email protected]"
.
<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.