AngularJs console.log “$q is not defined”

前端 未结 2 836
自闭症患者
自闭症患者 2021-02-20 02:46

I am getting this error in the console $q is not defined. When I did some research I found some thing like .q library has been deprecated from http://

2条回答
  •  情话喂你
    2021-02-20 03:07

    # in your console, try following code
    $injector = angular.injector(['ng']);
    q = $injector.get('$q');
    deferred = q.defer();
    # then do whatever you want
    

提交回复
热议问题