Skip to content

Commit 954ebe0

Browse files
Merge pull request chieffancypants#128 from timmckenzie/master
Returning XHR request with cfpLoadingBar:loaded
2 parents 9015398 + aff0ff6 commit 954ebe0

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

build/loading-bar.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ angular.module('cfp.loadingBarInterceptor', ['cfp.loadingBar'])
115115
'response': function(response) {
116116
if (!response.config.ignoreLoadingBar && !isCached(response.config)) {
117117
reqsCompleted++;
118-
$rootScope.$broadcast('cfpLoadingBar:loaded', {url: response.config.url});
118+
$rootScope.$broadcast('cfpLoadingBar:loaded', {url: response.config.url, result: response});
119119
if (reqsCompleted >= reqsTotal) {
120120
setComplete();
121121
} else {
@@ -128,7 +128,7 @@ angular.module('cfp.loadingBarInterceptor', ['cfp.loadingBar'])
128128
'responseError': function(rejection) {
129129
if (!rejection.config.ignoreLoadingBar && !isCached(rejection.config)) {
130130
reqsCompleted++;
131-
$rootScope.$broadcast('cfpLoadingBar:loaded', {url: rejection.config.url});
131+
$rootScope.$broadcast('cfpLoadingBar:loaded', {url: rejection.config.url, result: rejection});
132132
if (reqsCompleted >= reqsTotal) {
133133
setComplete();
134134
} else {

build/loading-bar.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/loading-bar.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ angular.module('cfp.loadingBarInterceptor', ['cfp.loadingBar'])
109109
'response': function(response) {
110110
if (!response.config.ignoreLoadingBar && !isCached(response.config)) {
111111
reqsCompleted++;
112-
$rootScope.$broadcast('cfpLoadingBar:loaded', {url: response.config.url});
112+
$rootScope.$broadcast('cfpLoadingBar:loaded', {url: response.config.url, result: response});
113113
if (reqsCompleted >= reqsTotal) {
114114
setComplete();
115115
} else {
@@ -122,7 +122,7 @@ angular.module('cfp.loadingBarInterceptor', ['cfp.loadingBar'])
122122
'responseError': function(rejection) {
123123
if (!rejection.config.ignoreLoadingBar && !isCached(rejection.config)) {
124124
reqsCompleted++;
125-
$rootScope.$broadcast('cfpLoadingBar:loaded', {url: rejection.config.url});
125+
$rootScope.$broadcast('cfpLoadingBar:loaded', {url: rejection.config.url, result: rejection});
126126
if (reqsCompleted >= reqsTotal) {
127127
setComplete();
128128
} else {

0 commit comments

Comments
 (0)