How can I manage elements dependent on angular $state change when opening a new window on $state.href?
<p>I have a specific angular view that needs to be opened in a new window without certain elements displayed (header/footer, etc).</p>

<p>At the moment I am achieving this by looking for the current state name in the layout view, and calling <code>$window.open</code> on <code>$state.href</code>:</p>

<p><strong>In the HTML</strong></p>

<pre><code>&lt;div id="header" ng-if="$state.current.name !='newWindowState'"&gt;
 //Header Content to hide in specific state
&lt;div&gt;
</code></pre>

<p><strong>In the controller</strong></p>

<pre><code>//... 
$scope.$state = $state;

$scope.OpenPage = function (params) {
  var url = $state.href('newWindowState' {param: params});
  $window.open(url, '_blank');
}
//...
</code></pre>

<p>While this "works", the new window opens <em>before</em> the 'newWindowState' is applied--causing some goofy behavior where the header &amp; footer are displayed for a few moments and then disappear once the $state change kicks in.</p>

<p><strong>Is there any way I can apply the $state update in the new window before rendering anything?</strong></p>

<p>Alternatively is there some kind of angular pattern I could use to achieve the same end? (That is, hiding or not including parent elements on a particular view in a new window, without visible delay.)</p>