NG-点击不离子滚动工作即使所有$范围变量是在一个对象 [英] ng-click not working in ion-scroll even when all $scope variables are in an object

查看:151
本文介绍了NG-点击不离子滚动工作即使所有$范围变量是在一个对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个 plnkr 这个问题。我不能让 NG-点击此页面上工作。我以为我可以解决这个问题,我用来自这个问题得到了答案:<一href=\"http://stackoverflow.com/questions/30187902/why-do-i-need-parent-to-enable-the-function-in-ng-click-when-using-ion-scroll\">Why用离子滚动的时候,我需要$家长,以便能够在功能NG-点击?

I have created a plnkr for this problem. I can't get the ng-click to work on this page. I thought I could solve this issue, with the answers I got from this question: Why do I need $parent to enable the function in ng-click when using ion-scroll?

但是,即使当我使用所有的 $范围变量不执行函数的对象。

But even when I use all the $scope variables in an object the function is not executed.

推荐答案

有关某种原因(我不是一个离子DEV),离子使得&LT;标签&gt; 吞下所有的点击事件。所以,你需要更改标签,以其他任何东西,或把 NG-重复外面。我写在 plunker

For some kind of reason (I am not an Ionic dev), ionic makes the <label> swallow all the click events. So you need to change that label to anything else or put the ng-repeat outside it. I wrote an example at plunker

<div ng-click="foo()">This one works</div>
<label>
  <div ng-click="foo()">This one doesn't</div>
</label>

这篇关于NG-点击不离子滚动工作即使所有$范围变量是在一个对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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