2

The Magento 2 documentation here states that you can use the custom Knockout JS scope binding in the standard format:

<div data-bind="scope: 'name.of.component'"></div>

But also in the format:

<scope args="'name.of.component'"></scope>

While the standard format is working fine, I'd like to use the <scope> format for a more 'containerless' approach, but I'm not having any joy. Has anyone got this working?

  • You can do it using item in your layout handle, <arguments> <argument name="jsLayout" xsi:type="array"> <item name="components" xsi:type="array"> <item name="name.of.component" xsi:type="array"> – Rakesh Jesadiya Sep 29 '17 at 11:09
  • Unfortunately name.of.component is dynamic so it can't be done in the layout. – Jonathan Hussey Sep 29 '17 at 11:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.