I have a phtml template that display the formkey in my html file. Below is how I'm displaying this
<form action=""
method="post"
id="form-validate-pound"
class="form form-cart">
<?= $block->getBlockHtml('formkey') ?>
<button type="submit"
name="click_for_pound_action"
data-cart-empty=""
value="click_pound"
title="<?= $block->escapeHtml(__('Click for Pound')) ?>"
class="action clear btn btn-yellow" id="click_pound_button">
<span><?= $block->escapeHtml(__('Click for Pound')) ?>
<i class="fa fa-plus"></i>
</span>
</button>
</form>
So basically I need to display <?= $block->getBlockHtml('formkey') ?>
in my knockoutjs template. Below I need to display it in this html file
<form action=""
method="post"
id="form-validate-pound"
class="form form-cart">
<!-- DISPLAY THE FORMKEY HERE -->
<button type="submit"
name="click_for_pound_action"
data-cart-empty=""
value="click_pound"
title="<?= $block->escapeHtml(__('Click for Pound')) ?>"
class="action clear btn btn-yellow" id="click_pound_button">
<span>
<!-- ko i18n: 'Click for Pound'--><!-- /ko -->
<i class="fa fa-plus"></i>
</span>
</button>
</form>