Get current value when change select option - Angular2

前端 未结 6 1501
走了就别回头了
走了就别回头了 2021-01-31 08:00

I\'m writing an angular2 component and am facing this problem.

Description: I want to push an option value in select selector to its handler when the

6条回答
  •  野的像风
    2021-01-31 08:43

    There is a way to get the value from different options. check this plunker

    component.html

     
    

    component.ts

        this.types = [ 'type1', 'type2', 'type3' ];
       this.order = {
          type: 'type1'          
      };  
    
      callType(value){
        console.log(value);
        this.order.type=value;
      }
    

提交回复
热议问题