I am trying to bind the expression used in a ng-show attribute to the result of a jQuery selector. The reason for this is that I need to hide/show an element based on the presence of another element (ng-view)
The markup I have currently is
<div ng-view id="partialView"></div>
<div ng-show="$('#partialView').length === 0">
<h1>MAIN CONTENT</h1>
</div>
and when this is rendered I get:
<!-- ngView: -->
<div ng-show="$('#partialView').length === 0" class="ng-hide">...</div>
when the ng-view is not provided, or
<div ng-view id="partialView">...</div>
<div ng-show="$('#partialView').length === 0" class="ng-hide">...</div>
the expression in the ng-show is not being evaluated (or maybe simply not re-evaluated).
My question is
Is this the correct way to bind the ng-show to the presence of another element in the DOM, and if it is the correct way to do it, what is wrong with my syntax that is stopping it from working?