我正在尝试使用bootstrap 3.3.6提供的元素标记,当在组件视图中使用它时,它会将错误作为未知元素抛出。
任何想法如何解决这个问题?
group(0)
当我这样做时,我得到error getting is 'blockquote-reverse' is not a known element
html view where blockquote-reverse is provided in bootstrap:
<blockquote-reverse>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
<footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
</blockquote-reverse>
Error in app/views/footer.component.html:2:81 caused by: Maximum call stack size exceeded
我可以通过不使用来避免这种情况,但我真的理解为什么angular2表现为/
答案 0 :(得分:1)
因为您应该使用.blockquote-reverse
作为类名而不是元素名称:
<blockquote class="blockquote blockquote-reverse">
...
</blockquote>
更多信息here
编辑:
你的 footer.component 也在递归地称呼自己
答案 1 :(得分:1)
你应该用这个:
<blockquote class="blockquote blockquote-reverse">
<p class="m-b-0">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
<footer class="blockquote-footer">Someone famous in <cite title="Source Title">Source Title</cite></footer>
</blockquote>