title: ng-class not working. Where did I do wrong?
body: <p>I know there are many problems here listed like this. but I can't pinpoint where I did wrong.. </p>
  
  <pre><code>&lt;li ng-repeat="item in type.sub | orderBy:y" ng-click="openpic($parent.$index, $index)" ng-class="{ 'active': $parent.$index + ':' + $index == current }"&gt;
  </code></pre>
  
  <p>we have <code>$scope.current</code> variable, and a nested menu with numbering id like 1:2, 1:3, 1:4, 2:1, 2:2, 2:3 and so on. </p>
  
  <p>Goal is very simple. I need to make this <code>&lt;li&gt;</code> active, if the <code>$parent.$index:$index</code> is equal to <code>$scope.current</code>. ID is set whenever <code>openpic($parent.$index, $index)</code> triggered. We have <code>li.active</code> class in css. </p>
  
  <p>So, can someone please show me, what's missing in that code?</p>
  
  <h2>TRY 1:</h2>
  
  <p>Tried:</p>
  
  <pre><code>&lt;li ng-repeat="item in type.sub | orderBy:y" ng-click="openpic($parent.$index, $index)" ng-class="{ 'active': $parent.$index + ':' + $index == $parent.current }"&gt;
  </code></pre>
  
  <p>Still not working. </p>
  
  <h2>TRY 2</h2>
  
  <p>I have something like this:</p>
  
  <pre><code>ng-class="{{ $parent.$index + ':' + $index == $parent.current &amp;&amp; 'active' || '' }}"
  </code></pre>
  
  <p>and it shows as <code>ng-class="active"</code> but <code>class</code> attribute did not updated.</p>
  
  <h2>TRY 3</h2>
  
  <pre><code>ng-class="{{ $parent.$index + ':' + $index == $parent.current &amp;&amp; 'highlight' || '' }}"
  </code></pre>
  
  <p>it shows <code>ng-class='highlight"</code>, but class still shows <code>class="ng-binding ng-scope"</code></p>
  
  <h2>TRY 4</h2>
  
  <pre><code>ng-class="isActive($parent.$index,$index)"
  </code></pre>
  
  <p>It solves the problem, but it seems a little bit overkill for a simple switch function. Any more ideas? </p>
  
  <h2>TRY 5</h2>
  
  <p>As per major-mann code suggestion that works at TRY 4, I made these adjustment, and surprisingly, it works.</p>
  
  <pre><code>ng-class="$parent.$index + ':' + $index == $parent.current &amp;&amp; 'active' || ''"
  </code></pre>
  
  <p>That one works. Removed all braces completely ????</p>