angularjs里绑定html元素,在页面的div里使用ng-bind-html
<!-- html--> <div class="info" ng-bind-html="info"> </div>
//用$sce服务
$scope.info = $sce.trustAsHtml(value.data.info);
现在发现如果有一个列表itemlist,每个item详情都有对应详情的html返回绑定。第一次随意点进一个item,
info div的高度是可以获取的,但是返回点击第二个item详情,它的info div的高度就是0,无论如何也取不到。
解决办法就是把cache设置为false,
.state(itemdetail', { cache: false, url: "/itemdetail/:itemId", templateUrl: "templates/.../itemdetail.html", controller: 'itemdetailCtrl' })
就是说是详情的缓存影响了,具体什么原因待我后面研究下再补充