Knockout “if” binding doesn't work with expression in a sortable list?

╄→尐↘猪︶ㄣ 提交于 2019-12-05 06:16:43

You've simply misunderstood the if-binding: It removes the content of the node it has been applied to, not the node itself. If you want to remove a node without creating a wrapper around it (that you can use to add the binding), there is also the comment-version of the if-binding, called the containerless control flow syntax:

<!-- ko if: time() == $root.limit() -->
  <div class="delimiter"></div>
<!-- /ko -->

http://jsfiddle.net/VaqqF/11/

Ref: http://knockoutjs.com/documentation/if-binding.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!