鉴于以下情况:
<div data-ng-repeat="val in vals">
<div data-ng-class:{'myClass':isEngineOn(val)}>
<span data-ng-show="isEngineOn(val)">yeah it's on</span>
<span data-ng-show="!isEngineOn(val)"> standby</span>
<button data-ng-disabled="isEngineOn(val)">Start engine</button>
<div>
</div>
isEngineOn 随我从服务器收到的 websocket 消息而变化。
有没有办法避免在每个摘要期间评估 isEngineOn,4 次,每个重复值?诸如初始化变量之类的东西?