New answers tagged knockoutjs
0
I got the answer. Hope it can help someone. It appears that I needed to explicitly require mage/calendar as shown below.
define([
'jquery',
'ko',
'Magento_Ui/js/form/element/abstract',
'mage/calendar'
], function ($, ko, Component) {
'use strict';
My initial understanding was that datepicker is part of the jQuery library and I didn't ...
0
This is because you are trying to apply the bindings which Magento already does, within Magento 2 you should never do this.
You will need to research UI Components to see how to use Knockout within Magento 2.
A very basic component utilising Knockout looks something like this:
define([
'ko'
], function (ko) {
'use strict';
return function (...
0
I have the same need, soon you found how to solve it?
0
It's obvious from the code that this.currencyRate is undefined
0
This means one of your values are not a number, either temp or this.currencyRate. My guess is that this.currencyRate is not returning a number (probably undefined).
In that case you need to change:
var currencyRate = config.currencyRate
to
this.currencyRate = config.currencyRate
Top 50 recent answers are included
Related Tags
knockoutjs × 708magento2 × 575
checkout × 172
javascript × 101
uicomponent × 69
magento-2.1 × 63
requirejs × 51
mini-cart × 37
template × 35
magento2.3 × 32
knockout × 31
jquery × 30
html × 26
magento2.2 × 25
onepage-checkout × 24
cart × 18
checkout-page × 16
frontend × 15
php × 14
payment-methods × 14
ajax × 14
layout × 13
magento2.2.2 × 12
billing-address × 11
product × 10