1
我有component0和component1。 component1是component0的子組件。 論component0代碼的打字稿我有一個枚舉「工人」有「A」和「B」。對component0模板(HTML),我有選擇適用COMPONENT1 看到這樣的:如何通過角2傳遞枚舉
<sel> </sel>
我想從組件1上傳遞一個枚舉類型,我可以檢查我獲得的巫婆值。
例如:
<sel [Worker]=Worker.A> </sel>
和組件1(後我得到@input淡水河谷) 的價值做一個開關外殼和檢查,如果我得到A/B
哪有我請這麼做?
[Angular2?:是否可以在HTML模板中使用自定義類型]的可能的複製(HTTP: //stackoverflow.com/questions/42244029/angular2-is-it-possible-to-use-custom-types-in-html-templates) – echonax