Circular dependency angularjs -


can tell me circular dependency in following code?

var homeapp = angular.module("homeapp",['nganimate', 'ui.bootstrap']);  'use strict';  homeapp.factory('admindashboardservice', ['$http', '$q', function($http, $q){       return {           'response': function(response) {               // on success               console.log("yes command comes here");               return response;             },          getallholidays: function(monthyeararrayforholidaylist) {             console.log("for full list of holidays list length: "+monthyeararrayforholidaylist.length);             var ismonthly="no";             return $http.get('/tasktrac/holiday/getholiday/ismonthly/'+ismonthly+'/'+monthyeararrayforholidaylist)                     .then(                             function(response){                                 return response.data;                             },                              function(errresponse){                                 //console.error('error while fetching holiday');                                 return $q.reject(errresponse);                             }                     );     }, }]);   homeapp.config(['$httpprovider', function($httpprovider) {       $httpprovider.interceptors.push('admindashboardservice'); }]); 

i stuck @ point please me favour in resolving issue. error got on browser please click here see error thank you..!!

a $http interceptor not declare $http dependency!

inject $injector:

homeapp.factory('admindashboardservice', ['$injector', '$q', function($injector, $q){       return {           'response': function(response) {               // on success               console.log("yes command comes here");               return response;             },          getallholidays: function(monthyeararrayforholidaylist) {             console.log("for full list of holidays list length: "+monthyeararrayforholidaylist.length);             var ismonthly="no";             return $injector.get("$http").get('/tasktrac/holiday/getholiday/ismonthly/'+ismonthly+'/'+monthyeararrayforholidaylist)                     .then(                             function(response){                                 return response.data;                             },                              function(errresponse){                                 //console.error('error while fetching holiday');                                 return $q.reject(errresponse);                             }                     );     }, }]); 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -