Using Bootstrap typeahead with Angular

前端 未结 7 1170
生来不讨喜
生来不讨喜 2020-12-23 22:35

I am currently developing a web application which uses twitter-bootstrap and Angularjs in good harmony. However, I have problems with the typeahead and using it as a ng-mode

7条回答
  •  臣服心动
    2020-12-23 22:44

    Here is another method I have used. It is dirty as well. This code can be dropped in your controller.

    $('#id_of_your_typeahead_input').change(function(event){
      $scope.$apply(function(scope){
        scope.your_ng_model = event.target.value;
      });
      $scope.your_ng_click_function();
    });
    

提交回复
热议问题