title: Switching views within the same controller whilst retaining scope data
body: <p>I have a page of data that can be viewed as a list or as markers on a map. It also has filtering in the sidebar. I currently have this structured as separate map and list pages but I want to merge them so that the filters remain when switching views.</p>
  
  <p>I have tried using <code>ui-router</code> but due to my markup I cannot keep the filtering within a parent state, as per my question here: <a href="https://stackoverflow.com/questions/33287030/how-do-i-show-multiple-views-in-an-abstract-state-template">How do I show multiple views in an abstract state template?</a></p>
  
  <p>My current markup is like this:</p>
  
  <pre><code>&lt;div class="main-container" ng-controller="PlanningCtrl" data-county-parish-id="1478"&gt;
      &lt;main class="page-content"&gt;
          &lt;!-- toggles between map and list views --&gt;
          &lt;a href="/map"&gt;View map&lt;/a&gt;
  
          &lt;!-- main content view here --&gt;
          &lt;appl-list&gt;&lt;/appl-list&gt;
  
          &lt;!-- &lt;appl-map&gt;&lt;/appl-map&gt; --&gt;
      &lt;/main&gt;
      &lt;aside class="sidebar"&gt;
          &lt;div refine-results info="refine" id="SearchForm" class="refine-search"&gt;&lt;/div&gt;
      &lt;/aside&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The data array is within the controller as <code>$scope.filteredApplications</code> and on each page this is filtering and displaying fine within each directive. </p>
  
  <p>I guess my question is: how can I toggle between the two <code>&lt;appl-*&gt;</code> directives and display the same filtered records?</p>