NG-Click事件不工作的下拉菜单中选择 [英] Ng-Click event not working on Select dropdown

查看:1382
本文介绍了NG-Click事件不工作的下拉菜单中选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HTML

<select ng-click="open()" ng-options="data in datas" id="myid"></select>

Angularjs

Controller('Myctrl', function($scope){
  $scope.open = function(){
     Console.log('No coming here')
});

我使用Jquery使用选择2选项相同的选择框:

I am using select2 option for same select box using Jquery:

$("#myid").select2({
  placeholder: "Select a state",
  allowClear: false
});

NG-点击器不点火&安培;没有出现在它占位符。

ng-click is not firing & place holder not appearing on it.

推荐答案

我有在选择NG-改变了同样的问题。运行时,但不是在第一次尝试。这种情况发生,如果容器选择NG出现假,然后开始内的执行更改为true。如果选择的父亲,初步显示(NG-显示= TRUE),它的工作原理以及改变选择。对于做任何解释?

I have the same problem with ng-change in the select. Runs, but not in the first attempt. This happening if the container select ng-show begins with false and then within the execution is changed to true. If the "father" of select, initially displays (ng-show = true), it works well change the select. Any explanation for this?

这篇关于NG-Click事件不工作的下拉菜单中选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆