P
P
Pavel Demyanenko2015-01-09 17:13:58
Angular
Pavel Demyanenko, 2015-01-09 17:13:58

Why is broadcasted event cfpLoadingBar:completed from angular-loading-bar duplicated?

I write this code to catch the state of the angular-loading-bar:

site.run ($rootScope) ->
  $rootScope.$on "cfpLoadingBar:loading", (event, data) ->
    console.log "loading", data
    return
  $rootScope.$on "cfpLoadingBar:completed", ->
    console.log "loaded"
    return

When ng-view is loaded, the status "loaded" is displayed in the console and all XHRs are completed, but when the template is loaded from the directive in this ng-view, I get the "loaded" status again. Is this correct behaviour? It's just written in the description of angular-loading-bar that "loaded" is broadcast when all XHR requests are finished.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav, 2015-01-09
Kozulya @5angel

The documentation talks about requests within the same time frame (100ms). It is possible that the template is loaded after the given time has elapsed. In any case, to answer accurately, you need to look at a specific example.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question