数据存在一个数组里面,需要把这些数据显示到HTML页面上,目前是通过ng-repeat方式来显示。但是数组中title这一项的字符长度比较长,所以想要限制一下这段字符在HTML页面上显示时,超过指定的长度后面的内容就会以省略号的形式显示。请问要怎么样实现?html页面:{{x.title}}
{{x.cost}}
数据格式如下:$scope.TU=[{"tuid":"xy0001","imgurl":"img/178.jpg","title":"哈哈哈哈哈哈哈哈哈","cost":"86"},{"tuid":"xy0002","imgurl":"img/178.jpg","title":"呵呵呵呵呵呵呵呵呵呵呵呵","cost":"96"},{"tuid":"xy0003","imgurl":"img/178.jpg","title":"嘿嘿嘿嘿嘿嘿嘿嘿嘿嘿嘿嘿嘿嘿嘿嘿嘿嘿","cost":"89"}]
狐的传说
相关分类