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文檔。