热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

angularJs点击一次响应多次

12345678910111213141516171819202122232425262728293031323334353637383940414243444546app.directive("lo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
app.directive("loadTxmethods", [

  "$location",

  function($location) {

    return {

      restrict: "A",

      template: `


       


          请选择提款方式

         


           


             

             

           


           

           

         


         


           

温馨提示:银行卡单次最高限额100000元



           

温馨提示:支付宝单次最高限额50000元



         


         
提交


       


      `,

      link: function(scope, element, attrs, ngModel) {

        scope.getTxid = function(id){

          scope.txid = id;

        }

        scope.showTxmethods= function(){

          scope.connection.send(JSON.stringify({type:'bindCardList'}));

          $('.loadTxmethods').show();



          var txSubmit = document.querySelectorAll("footer.txSubmit");



          angular.element(txSubmit).on("click", function(event) {

            console.log(scope.txid)

          });

        }

        scope.hideTxmethods = function(){

          $('.loadTxmethods').hide();

          scope.txid = "";

        }



      }

    };

  }

]);

为什么点击提交按钮会响应多次,如何解决呢?


推荐阅读
author-avatar
广告公司英子
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有