The visible function from the knockout template to knockout js

The way to link the visible function from the template and js file

<button class="checkout payment"
                        type="submit"
                        data-bind="
                        fadeVisible: isVisible()
                        ">
                </button>
define(
    [
        'jquery',
    ],
    function ($) {
        'use strict';
        return Component.extend({
            isVisible: function () {
                return 1;
            },
        });
    }
);

Thank you.

Leave a comment

Your email address will not be published. Required fields are marked *