logout() 具有打开模型的代码。我只想在 rootscope 中的 angularjs 对象值为 true 时调用 logout() 函数。如何从 javascript 检查 rootscope 对象中的内容?
<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>