I'm seeking some assistance. I am trying to incorporate multiple conditions within a single ng-if
directive using Angular.js, but encountering the following error.
Error: [$parse:syntax] Syntax Error: Token '<' not a primary expression at column 87 of the expression [$parent.$parent.$index != 1 && $parent.$index != 0 && $index !=1>
<div class=] starting at [<div class=].
http://errors.angularjs.org/1.4.7/$parse/syntax?p0=%3C&p1=not%20a%20primary%20expression&p2=87&p3=%24parent.%24parent.NaNndex%20!%3D%201%20%26%26%20%24parent.%index%20!%3D%200%20%26%26%20%24index%20!%3D1%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%class%3D&p4=%3Cdiv%class%3D
at http://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.js:68:12
at AST.throwError (http://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.js:13057:11)
at AST.primary (http://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.js:12960:12)
at AST.unary (http://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.js:12940:19)
at AST.multiplicative (http://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.js:12927:21)
at AST.additive (http://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.js:12918:21)
...
<p>Below is an explanation of my code.</p>
<pre><code><div ng-if="$parent.$parent.$index != 1 && $parent.$index != 0 && $index !=1>
<div class="panel-group accordion-content-div accordioninner accordioninner-inner">
<div class="panel panel-default" style="border:1px solid #66afe9;">
<div class="panel-heading">
<a class="panel-title sky-blue-light auditformpopup" role="button" ng-click="getAllNextPreviousIds(cd.sub_sub_id,$index,$parent.$index,$parent.$parent.$index)">
{{cd.des}}
</a>
</div>
</div>
</div>
In this scenario, I need to utilize the AND
operator and consider both parent indexes for this div. Any guidance on resolving this issue would be greatly appreciated.