这是我的代码的简化想法。$scope.events
是一个多维数组,我的 HTML 是:
<div ng-repeat="event in events" >
{{event.owner_id.$oid}} //renders the $oid
<div ng-if="event.owner_id.$oid == 20">
Code to be rendered if true
</div>
</div>
但是我从角度得到以下错误:
Error: [$parse:syntax] http://errors.angularjs.org/undefined/$parse/syntax?p0=a02c36b440519dc1aa6&p1=is%20an%20unexpected%20token&p2=30&p3=event.owner_id."<!-- ngIf: event.owner_id.$oid == 52408a02c36b440519dc1aa6 -->"id%20%3D%3D%20%2052408a02c36b440519dc1aa6&p4=a02c36b440519dc1aa6
我该如何解决这个问题?