Analog of ngTransclude in Angular.Dart

后端 未结 1 888
谎友^
谎友^ 2021-01-13 10:57

I\'m trying to figure out how to make a component render its children.

So I can compile:



        
相关标签:
1条回答
  • 2021-01-13 11:29

    AngularDart uses Shadow DOM in place of ngTransclude. This is one of the ways we are pushing Angular into the browser with emerging web standards.

    Adding a <content> tag instead your component's template will cause the child element to be placed there.

    e.g. in your example <my-component>'s template might look like:

    <div id="parent">
      <!-- some component stuff -->
      <content></content>
    </div>
    

    For even more awesomeness, you can use Shadow DOM's content selectors as well to control which child elements are displayed.

    0 讨论(0)
提交回复
热议问题