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