栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

调试量角器到角度同步问题的规范方法

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

调试量角器到角度同步问题的规范方法

好的,这个问题引起了我的兴趣,因此我想出了一个程序化的解决方案来确定如何等待量角器:

var _injector = angular.element(document).injector();var _$browser = _injector.get('$browser');var _$http = _injector.get('$http');var pendingTimeout = true;//this is actually method that protractor is using while waiting to sync//if callback is called immediately that means there are no $timeout or $http calls_$browser.notifyWhenNoOutstandingRequests(function callback () {  pendingTimeout = false});setTimeout(function () {  //this is to differentiate between $http and timeouts from the "notifyWhenNoOutstandingRequests" method  if (_$http.pendingRequests.length) {    console.log('Outstanding $http requests', _$http.pendingRequests.length)  } else if (pendingTimeout) {    console.log('Outstanding timeout')  } else {    console.log('All fine in Angular, it has to be something else')  }}, 100)

在这里,在http://plnkr.co/edit/O0CkpnsnUuwEAV8I2Jil?p=preview中,您可以尝试超时和$
http调用,我的延迟端点将等待10秒才能解决该调用,希望对您有所帮助为了你



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/633161.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号