程序问答   发布时间:2022-06-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了角度ui-bootstrap typeahead selectAatch回调吗?大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决角度ui-bootstrap typeahead SELEctAatch回调吗??

开发过程中遇到角度ui-bootstrap typeahead SELEctAatch回调吗?的问题如何解决?下面主要结合日常开发的经验,给出你关于角度ui-bootstrap typeahead SELEctAatch回调吗?的解决方法建议,希望对你解决角度ui-bootstrap typeahead SELEctAatch回调吗?有所启发或帮助;

现在有更好的方法。添加了新的回调方法

在控制器文件中添加以下内容:

 $scope.onSELEct = function ($item, $model, $label) {
    $scope.$item = $item;
    $scope.$model = $model;
    $scope.$label = $label;
};

在视图中添加以下内容:

 <input type="text"
        ng-model="SELEcted"
        typeahead="state for state in states | filter:$vIEwValue"
        typeahead-editable="false"
        typeahead-on-SELEct="onSELEct($item, $model, $label)"/>

有关更多信息,请参见预先输入规范(搜索onSELEct)。

查看以下网址是否对http://www.techguides.in/how-to-create-autocomplete-using-angularjs- ui/有帮助

http://www.techguides.in/how-to-customize-autocomplete-to-display-multiple- columns-using-angularJs-ui-2/

解决方法

我正在使用有角度的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">

如果我观看选定的值,则每按一次键都会得到更改&Hellip;

scope.$watch('SELEcted',function(newValue,oldvalue) {... });

我知道方法SELEctMatch是在用户按Enter或单击列表时调用的方法,但我不知道如何对此进行回调&Hellip;

谢谢 !

大佬总结

以上是大佬教程为你收集整理的角度ui-bootstrap typeahead selectAatch回调吗?全部内容,希望文章能够帮你解决角度ui-bootstrap typeahead selectAatch回调吗?所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。