I am new to magento2. i'm trying to create a popup-modal for my new form. I have created a popup which works fine but unable to create a modal.
Following is the code for popup which loads on page load–
require([
'jquery',
'Magento_Ui/js/modal/alert'
],
function($, alert) {
alert({
title: "Some title",
content: "we can show popuop based on cookies later",
autoOpen: true,
clickableOverlay: false,
focus: "",
actions: {
always: function(){
console.log("modal closed");
}
}
});
}
);
Please help me to create a modal. Any help is really appreciated.
Best Answer
Try below code: