我正在使用角度ui-bootstrap typeahead,我想用它作为一种方法来获取很多选择,所以我需要在selectMatch方法启动时获取所选值但我找不到怎么做在我的控制器中
<div class='container-fluid' ng-controller="TypeaheadCtrl">
<pre>Model: {{selected| json}}</pre>
<input type="text" ng-model="selected" typeahead="state for state in states | filter:$viewValue">
Run Code Online (Sandbox Code Playgroud)
如果我看到所选的值,每按一次键我都会得到更改...
scope.$watch('selected', function(newValue, oldValue) {... });
Run Code Online (Sandbox Code Playgroud)
我知道方法selectMatch是当用户按下回车或点击列表时调用的方法,但我不知道如何对其进行回调...
谢谢 !