Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/444.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript AngularJS函数在页面呈现后连续调用_Javascript_Angularjs_Stack Trace - Fatal编程技术网

Javascript AngularJS函数在页面呈现后连续调用

Javascript AngularJS函数在页面呈现后连续调用,javascript,angularjs,stack-trace,Javascript,Angularjs,Stack Trace,我有一个ng repeat,它循环遍历从promise返回的元素。两件奇怪的事情正在发生。1.虽然我可以看到承诺返回一个元素,但我看到有一个元素呈现为HTML,但在控制台中,我看到4条消息,暗示函数被调用了4次。2) 大约每30秒,ng repeat就会再次初始化,因为我看到相同的console.log消息每30秒出现4次 <ion-item cache-view="true" class="item-avatar item-icon-right" style="min-hei

我有一个ng repeat,它循环遍历从promise返回的元素。两件奇怪的事情正在发生。1.虽然我可以看到承诺返回一个元素,但我看到有一个元素呈现为HTML,但在控制台中,我看到4条消息,暗示函数被调用了4次。2) 大约每30秒,ng repeat就会再次初始化,因为我看到相同的console.log消息每30秒出现4次

      <ion-item cache-view="true" class="item-avatar item-icon-right" style="min-height:60px;" ng-repeat="crR in currentR" type="item-text-wrap" href="#/tab/rLater/{{crR.bid}}">
        <div>
          <img id="crR_IconImage" style='margin:0px 8px 0px 0px;float:left;max-width:40px;height:auto;' ng-src="{{crR.fullLogo}}">
          <h3>{{crR.pDate}} @ {{crR.pTime}} (${{crR.quoted}})</h3>
          <p style="padding-top:5px;font-size:12px;">{{crR.vName}}, Status:
            <span>{{getConfName(crR.confirmed)}}</span>
          <i id="customIcon" class="icon ion-chevron-right icon-accessory"></i>
        </div>
      </ion-item>
在console.log中,我看到
value=0
打印了四次……然后每隔30秒,
value
再打印四次。我试着加上:

console.log("caller is " + arguments.callee.caller.toString());
但由于
调用方
未定义,因此会出错。如果我这样做:

console.log("caller is " + arguments.callee.toString());
我看到上面的功能打印到控制台上:

caller is function (value) {
    console.log("caller is " + arguments.callee.toString());
    console.log("value: " +value) ;
    if (value == 0) {
      return "Not Confirmed" ;
    } else if (value == 1) {
      return "Confirmed" ;
    } else if (value == 2) {
      return "Cancelled by Vendor" ;
    } else if (value == 3) {
      return "Cancelled by user" ;
    } else if (value == 4) {
      return "Modified by Vendor" ;
    } else if (value == 5) {
      return "Modified by User" ;
    }
  }
我一辈子都搞不懂为什么
value=0
每隔30秒就不断地打印到控制台上……每次打印四次。还有一件事我觉得不应该与之相关,那就是我每隔30秒就在应用程序屏幕上打印一次AdMob广告……广告更改console.log
value
消息出现的那一刻。它与上面的功能类似,是在新广告发布时如何触发的。这对我来说毫无意义

caller is function (value) {
    console.log("caller is " + arguments.callee.toString());
    console.log("value: " +value) ;
    if (value == 0) {
      return "Not Confirmed" ;
    } else if (value == 1) {
      return "Confirmed" ;
    } else if (value == 2) {
      return "Cancelled by Vendor" ;
    } else if (value == 3) {
      return "Cancelled by user" ;
    } else if (value == 4) {
      return "Modified by Vendor" ;
    } else if (value == 5) {
      return "Modified by User" ;
    }
  }