ng-repeat 如若数据为空用 替换占位
ng-repeat 如果数据为空用 替换占位
<div class="float_left width_50 border_b_top_eee border_b_right_eee bg_ff padding_left_15 padding_right_15 padding_top_10 line_height_15" ng-click="addPackage($event,{{item.id}})" ng-repeat="item in deviceTypeLists"> <div class="color_e5005a font_16 oneline_nobreak"> {{item.name}} </div> <div class="color_99 oneline_nobreak"> {{item.description || "&nb"+"sp;"}} </div> <div class="line_height_40px color_e5005a"> ¥ <span ng-bind="item.price"> </span> </div> </div>
如果item.description为null 或者为“”,则显示后面的内容
{{item.description || "&nb"+"sp;"}}