ng2-slim-loading-bar icon indicating copy to clipboard operation
ng2-slim-loading-bar copied to clipboard

Complete callback passed to start method doesn't work

Open g-serghei opened this issue 8 years ago • 4 comments

When using this construction:

this.loadingBar.start(() => {
    console.log('completed');
});

the complete callback is not called, it seems that you did not implemented it in your source code

start(onCompleted:Function = null) {
    // Stop current timer
    this.stop();
    // Make it visible for sure
    this.visible = true;
    // Run the timer with milliseconds iterval
    this._intervalCounterId = setInterval(() => {
        // Increment the progress and update view component
        this.progress++;
        // If the progress is 100% - call complete
        if (this.progress === 100) {
            this.complete();
        }
    }, this.interval);
}

g-serghei avatar Sep 29 '16 08:09 g-serghei

This is not done yet , i too had the same problem. But in my case i dont want to do anything after that , perhaps you can include an EventEmitter in his code.

niyazhussain avatar Sep 29 '16 09:09 niyazhussain

Thanks all I think it would be better to return the Promise as a result of this file. Will fix it soon.

akserg avatar Oct 02 '16 17:10 akserg

no update yet on this issue

theoomoregbee avatar May 09 '17 13:05 theoomoregbee

gotten a way around it, subscribed to thethis._loadingBar.events.subscribe(item => console.log(item)); then if it is of progress we can check the percentage and then check if it is 100% or not

theoomoregbee avatar May 09 '17 14:05 theoomoregbee