Need a content section for components like Angulars ng-content

72 views
Skip to first unread message

Ronln

unread,
Aug 12, 2021, 9:45:33 PM8/12/21
to KnockoutJS
I've been looking for a functionality like Angulars ng-content which allows to place different sections in a component that can be filled with controls and keep a binding to the parent component. What I'm looking for is the ability to have something like this:

<component-name params="...">
  <section Name1> Html content  </section>
  <section Name2> More Html content  </section>
  <section Name3> Html content with binding to component-name parent  </section>
</component-name>

This way I would be able to define any html structure and use the component as a canvas for other elements.

Knockouts component markup only allows to set a single template, and its has to be bound to the component, not the parent.

Has anyone solved this?
Reply all
Reply to author
Forward
0 new messages