Angular组件如何嵌套无序列表 inside paragraph ?

问题描述 投票:1回答:1

当角度组件的模板中存在以下标记时,Angular会引发错误。

Template parse errors: Unexpected closing tag "p"

<p>
  paragraph begins.
  <ul>
    <li>list item 1</li>
    <li>list item 2</li>
  </ul>
</p>

如何实现这种嵌套。

angular templates html-lists paragraphs
1个回答
1
投票
  • 段落不能包含列表。
  • 除非该段落完全包含在单个列表项中,否则列表不能包含段落。

因为pul是元素呈现为块。

© www.soinside.com 2019 - 2024. All rights reserved.