title: Can I use a ternary operator with angularjs outside of the class attribute?
body: <p>I'm looping through a json object with AngularJS, and having trouble dealing with nulls. </p>
  
  <p>I'm new to Angular.</p>
  
  <pre><code>&lt;a href="#" data-mycustom="{{product.related}}"&gt;...&lt;/a&gt;
  </code></pre>
  
  <p>In the event of related being null:</p>
  
  <pre><code>{
      "related":null
  }
  </code></pre>
  
  <p>I want to put a "-1" in its place:</p>
  
  <pre><code>&lt;a href="#" data-mycustom="-1"&gt;...&lt;/a&gt;
  </code></pre>
  
  <p>Tried ternary operator but it isn't evaluating... it's just displaying it as plain text.</p>