我有一个tel过滤器,我只想在满足条件的情况下应用它。我该怎么做呢?
这是我目前的代码:
<span class="display-block" ng-show="event.category == 'Entry' && v" ng-repeat="(k, v) in properties">
<strong>{{k | sentenceCase}}:</strong> {{v | tel}}
</span>发布于 2016-01-02 21:18:54
尝试使用三元操作符,就像在JS中那样:
{{ condition ? (v | tel) : v }}发布于 2016-01-02 23:01:50
<strong>{{k | condition?filterByThisIfTrue |orFilterByThis}}:</strong> https://stackoverflow.com/questions/34570818
复制相似问题