Skip to content

Instantly share code, notes, and snippets.

@shakyShane
Created August 22, 2018 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shakyShane/94bec54aee6e5fca26cf1c7656bdbb39 to your computer and use it in GitHub Desktop.
Save shakyShane/94bec54aee6e5fca26cf1c7656bdbb39 to your computer and use it in GitHub Desktop.
<!-- app/code/Simmi/Theme/view/frontend/web/template/account.html -->
<div data-bind="text: loadingText"></div>
// app/code/Simmi/Theme/view/frontend/web/js/account.js
define([
"uiComponent",
"jquery",
"ko",
"underscore",
"mage/translate",
], function(Component, $, ko, _, $t) {
return Component.extend({
defaults: {
template: 'Simmi_Theme/account.html',
loadingText: $t('Please wait...'),
},
initialize: function() {
var self = this;
self._super();
// any other init code here
}
});
});
<!-- app/code/Simmi/Theme/view/frontend/templates/account.phtml -->
<div data-bind="scope: 'accountOverlay'" id="account-overlay">
<!-- ko template: getTemplate() --><!-- /ko -->
</div>
<script type="text/x-magento-init">
{
"*": {
"Magento_Ui/js/core/app": {
"components": {
"accountOverlay": {
"component": "Simmi_Theme/js/account"
}
}
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment