从角度导出q?

时间:2014-05-29 06:03:25

标签: angularjs debugging q

出于调试目的,我需要从全局js范围或控制台中导出$q对象angular对象。有没有办法做到这一点?

伪代码: var q = voodoo(angular);var q = angular.DO().$something

1 个答案:

答案 0 :(得分:1)

试试这个:

var $injector = angular.injector(['ng']);
var $q = $injector.get('$q');
var deferred = $q.defer();
... etc