Analog of ngTransclude in Angular.Dart

痞子三分冷 提交于 2019-12-01 06:04:45
James deBoer

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!