title: Angular | Display element conditionally
body: <p>I'm trying to display an element conditionally. This code that I applied to the element should work:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;a [style.display]=&quot;chatIsToggled ? 'display: block' : 'display: none'&quot;&gt;
    link
  &lt;/a&gt;
  </code></pre>
  <p>The problem is that Angular doesn't apply the style because of &quot;unsafe style value&quot;</p>
  <blockquote>
  <p>WARNING: sanitizing unsafe style value display: none (see <a href="http://g.co/ng/security#xss" rel="nofollow noreferrer">http://g.co/ng/security#xss</a>).</p>
  </blockquote>
  <p>What would be an equivalent way to achieve what I want to do?</p>