I have encountered a situation on one of my website pages where I am using directives within ng-switch, as shown below:
<div ng-switch="contentMenuObj.model">
<div ng-switch-when="calendar">
// Directive specific to the calendar view
</div>
<div ng-switch-when="history">
// Directive specific to the history view
</div>
</div>
Each time I switch between views (from calendar to history) and then return (from history to calendar), Angular re-renders the calendar view causing new queries to be made to the server.
This behavior has raised a question for me - is it possible for Angular not to re-render the views? If this is not feasible, what would be the most effective approach to resolve this issue?