简体   繁体   English

给 Angular 元件选择器现有 html 元件

[英]Giving Angular component selector existing html element

What happens when I set the selector of some component to div or body or p ?当我将某些组件的选择器设置为divbodyp时会发生什么?

The behavior I notice ranges form nothing being rendered to partial rendering and as far as crashing/not loading the page.我注意到的行为范围从没有渲染到部分渲染以及崩溃/不加载页面。

Why the inconsistent behavior?为什么不一致的行为?

Just wondering, it doesn't throw an error and I couldn't find info on google, obviously you are not supposed to do it, but what happens behind the scenes?只是想知道,它不会引发错误,而且我在谷歌上找不到信息,显然你不应该这样做,但幕后会发生什么?

here the naming convention for angular: style guide component selector这里是 angular 的命名约定:样式指南组件选择器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM