如何在淘汰模板中管理日志 [英] How do you console log inside a knockout template
本文介绍了如何在淘汰模板中管理日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我认为这是正确的:
<div data-bind="foreach: amount_options, visible: $parent.displayAskAmoutRadioButtons()">
<!-- ko console.log(amount_option) --><!-- /ko -->
<label class="donor-js-amount-choice">
<!-- <input type="radio" class="donor-js-webware" name="gift_amt" data-bind="attr: {value: key}, checked: $parent.amountSelected"><span class="donor-js-currency-symbol" data-bind="html: $root.session.currencySymbol"></span> <span class="donor-js-input-currency" data-bind="text: desc"></span> <span class="donor-js-input-currency"></span><br> -->
</label>
</div>
显然不是因为什么也没放到控制台上.标记的注释行引发了关于value: key
的错误,我需要知道这些amount_options
之一内部的内容.
apparently not as nothing gets out put to the console. The commented out line of tag is throwing an error about the value: key
and I need to know whats inside of one of these amount_options
.
想法?
推荐答案
尝试一下.敲除应该评估绑定值并刷新到控制台.
Try this. Knockout should evaluate value for binding and flush to console.
<div data-bind="text: console.log(amount_option)"></div>
这篇关于如何在淘汰模板中管理日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文