The logout() has the code to open model. I only want logout() function to be called if the angularjs object value inside rootscope is true.. How do I check from javascript what is inside 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();//here add if rootscope.mydata == true
</script>
</body>