我在服务中使用了
var id = $q.resolve(rid);
当我试图对jasmine单元进行测试时,我收到错误TypeError: $q.resolve is not a function
。这是我注册$q
var initService = angular.mock.inject(['service', '$q', '$rootScope', function(_service_, q, rootScope) {
service = _service_;
$q = q;
$rootScope = rootScope;
}]);
知道缺少什么吗?