Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/445.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript ng绑定html在绑定数据更改时清空页面_Javascript_Html_Angularjs - Fatal编程技术网

Javascript ng绑定html在绑定数据更改时清空页面

Javascript ng绑定html在绑定数据更改时清空页面,javascript,html,angularjs,Javascript,Html,Angularjs,我试图实现类似Quora的read-on功能,当扩展时,将显示更多内容 我正在使用ng绑定html将html页面绑定到p元素中 <p ng-show="viewModel.level==0" ng-bind-html="viewModel.content0 | sanitize"> <p ng-show="viewModel.level==1" ng-bind-html="viewModel.content1 | sanitize"> 扩展工作正常,但当从级别1折

我试图实现类似Quora的read-on功能,当扩展时,将显示更多内容

我正在使用ng绑定html将html页面绑定到p元素中

<p ng-show="viewModel.level==0" ng-bind-html="viewModel.content0 | sanitize">
<p ng-show="viewModel.level==1" ng-bind-html="viewModel.content1 | sanitize">

扩展工作正常,但当从级别1折叠到级别0(从更多内容到更少内容)时,html页面将变为空白,并卡在那里,直到您单击或拖动页面


如何避免这种情况?

我偶然得到了答案

我需要的是通知列表大小已更改:

$scope.$broadcast('scroll.resize');