NgbTypeahead selectItem get clicked item ngBootstrap angular2

前端 未结 1 644
温柔的废话
温柔的废话 2020-12-11 01:03

In this answer, it was explained to me to use selectItem to get the select event.

But at this point, the model I bound to the text box is still the original text th

1条回答
  •  遥遥无期
    2020-12-11 01:17

    You should be using $event to get the selected Items as below

    
    
    Model: {{ model | json }}
    clicked item {{clickedItem}}

    Your method should be as

    selectedItem(item){
        this.clickedItem=item.item;
        console.log(item);
      }
    

    LIVE DEMO

    0 讨论(0)
提交回复
热议问题