I thought this was correct:
<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>
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
.
Ideas?
applyBindings do, The first parameter says what view model object you want to use with the declarative bindings it activates. Optionally, you can pass a second parameter to define which part of the document you want to search for data-bind attributes. For example, ko.
The $data variable is a built-in variable used to refer to the current object being bound. In the example this is the one of the elements in the viewModel.
Knockout is a JavaScript library that helps you to create rich, responsive display and editor user interfaces with a clean underlying data model.
Try this. Knockout should evaluate value for binding and flush to console.
<div data-bind="text: console.log(amount_option)"></div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With