ng-bind 未初始化完成不加载数据,避免产生{{}}导致页面混乱
还是上边的例子,当前页面没有加载完成的时候,页面显示是不完整的会频繁的出现{{}}这样子的表达式语句,给用户的感觉很不和谐,所以使用ng-bind使没有完成的加载双大括号表达式不显示在页面上
<input type="text" value="" ng-model="name"/>
<input type="text" value="" ng-model="age"/>
<div ng-bind="name"> 
<div ng-bind="age"> 
<script>
alert(3);//使用alert中断加载
</script>
页面未加载完成不显示{{}}
angularJs-未加载完成的页面显示混乱ng-bind
 
 
 
加载完成之后页面显示文本,同时在name,age上添加了ng-binding 的class
 
angularJs-未加载完成的页面显示混乱ng-bind
 

相关文章:

  • 2022-12-23
  • 2021-08-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-06
  • 2021-12-03
  • 2022-12-23
  • 2021-05-10
  • 2021-08-14
  • 2021-12-09
相关资源
相似解决方案