Get Value From Select Option in Angular 4

前端 未结 5 1138
难免孤独
难免孤独 2020-11-28 10:09

How do I get the value from the select option in Angular 4?

I want to assign it to a new variable in the component.ts file. I\'ve tried this but outputs nothing.

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 10:56

    HTML code

        

    Component code

    HelloCorp(corporation) {
        var corporationObj = corporation.value;
    }
    

提交回复
热议问题