0
我有时意识到我已经看到angular2代码为:Angular2组件选择器:阵列像 '[UI-组分]'
@Component({
selector: '[ui-components]'
什么selector: '[ui-components]
意思?
我有时意识到我已经看到angular2代码为:Angular2组件选择器:阵列像 '[UI-组分]'
@Component({
selector: '[ui-components]'
什么selector: '[ui-components]
意思?
这意味着您将组件作为属性组件而不是元素组件。当您使用您的HTML组件,你写
<div ui-components></div>
如果使用
@Component({
selector: 'ui-components' // without the brackets
你必须在你的HTML
<ui-components></ui-components>
Here使用这个符号是一些读数从Angular2文档。