3
我需要實現自定義日期選擇器。
爲此我有date-picker.directive和select-date.component(對話窗口)。從指令實例化組件
我通過html中的屬性附加指令,並可以處理事件。通過點擊事件指令應該調用對話窗口(這是我們的組件)。
<button class="btn" type="button" date-picker>
但是我怎樣才能從指令實例化select-date.component?
如何將新組件添加到DOM?
GünterZöchbauer,您的解決方案有助於訪問已存在的組件。是否有可能創建一個組件的新實例並將其添加到DOM? – rnofenko
查看http://stackoverflow.com/questions/36325212/angular-2-dynamic-tabs-with-user-click-chosen-components/36325468#36325468舉例 –
GünterZöchbauer,感謝您的幫助,但您的榜樣演示如何從component_創建_component。當我想從directive_找到_component的解決方案時。 – rnofenko