To trigger the logout() function, it should only execute if the value of an AngularJS object within rootscope is true. How can I validate this using JavaScript to check the content of the rootscope object?
<body ng-controller="myController">
<div id="myPopup" modal custom-model fade" style="left:20%"
data-backdrop="static" data-keyboard="false">
<div class="modal-dialog">
<div class="modal-content">
<div class="custom-modal-header">
</div>
<div class="custom-modal-body">
</div>
<div class="custom-modal-footer">
</div>
</div>
</div>
</div>
<script type="text/javascript">
logout();//add condition to check for rootscope.mydata being true
</script>
</body>