In AngularJS, how can I create a composite variable in my view without it showing?
<p>In AngularJS in my view I can create composite variables like such:</p>

<pre><code>{{shouldShow = !isNew &amp;&amp; !uploading}}
</code></pre>

<p>This is great because I can encapsulate simple UI logic in the UI and leave my controller to deliver functional values, and the composite variable magically updates as its dependencies do.</p>

<p>But the problem is this results in the actual text of the value being shown in my view.</p>

<p>I can do this:</p>

<pre><code>&lt;div ng-show="false"&gt;{{shouldShow = !isNew &amp;&amp; !uploading}}&lt;/div&gt;
</code></pre>

<p>But it smells. I realise I have answered my own question, technically, as I have a working solution, but I feel I must be missing an AngularJS feature, because if they have gone to the effort of allowing such variables then there must be a non-hacky way to not show them.</p>

<p>So, is there a better way to define composite variables in my view and not have them print out?</p>

<p><strong>Edit</strong></p>

<p>The two main suggestions are <code>ng-init</code> or doing <code>{{ ' ' || shouldShow = !isNew &amp;&amp; !uploading}}</code>. The third still being my option. I have summarised my testing below:</p>

<h2>1</h2>

<pre><code>&lt;div ng-init="shouldShow = !isNew &amp;&amp; !uploading"&gt;&lt;/div&gt;
</code></pre>

<p><a href="https://jsfiddle.net/joshcomley/94627y1u/" rel="nofollow">https://jsfiddle.net/joshcomley/94627y1u/</a><br/>
This doesn't actually work, because it doesn't update the composite as the dependencies change.</p>

<h2>2</h2>

<pre><code>{{ ' ' || shouldShow = !isNew &amp;&amp; !uploading }}
</code></pre>

<p><a href="https://jsfiddle.net/joshcomley/8eqb07ph/" rel="nofollow">https://jsfiddle.net/joshcomley/8eqb07ph/</a><br/>
This doesn't work either, it just results in an error in AngularJS</p>

<h2>3</h2>

<pre><code>&lt;div ng-show="false"&gt;{{ shouldShow = !isNew &amp;&amp; !uploading }}&lt;/div&gt;
</code></pre>

<p><a href="https://jsfiddle.net/joshcomley/ck2a0syk/" rel="nofollow">https://jsfiddle.net/joshcomley/ck2a0syk/</a><br/>
My original way so far is the only way that works and updates as the dependencies change.</p>