0
我想就這個問題尋求幫助。我正在研究角2和離子中的動態組件:請檢查下面的情況。Angular2/Ionic 2動態組件屬性
我有分量的名字按鈕組件:
<button-component [label]="I'm a button" **small**></button-component>
小 - 必須在按鈕元素進行動態輸入像 大, 大。
內部按鈕組件視圖文件我有:
<button "the single attribute must appear here like small">{{label}}</button>
輸出將是<button small>I'm a button</button>
我試圖在角2中的所有屬性綁定,但是這是離子性質。
我怎樣才能做到這一點與離子2和角2.通過使用動態單屬性屬性。
在此先感謝。
會嘗試這一個,謝謝您在./ButtonComponent類ButtonComponent – frogcoder
錯誤 - 致:未能執行的「元素」的setAttribute「:「{{大小}}」不是有效的屬性名稱。 – frogcoder
嘗試更新的代碼 – TheUnreal