You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Code To: SlimLoadingBarService.start(()=>{alert("complete!")});
When I run the code ,it start ok but can't get my completed status like the "complete!";
I check your slim-loading-bar.service.js code on [email protected].
it does not has the function to onComplete ,
then i fix it simple and the code is down:
SlimLoadingBarService.prototype.start = function (onCompleted) {
var _this = this;
if (onCompleted === void 0) {
onCompleted = null;
}else
this.onCompleted=onCompleted;
// Stop current timer
this.stop();
// Make it visible for sure
this.visible = true;
// Run the timer with milliseconds iterval
this._intervalCounterId = setInterval(function () {
// Increment the progress and update view component
_this.progress++;
// If the progress is 100% - call complete
if (_this.progress === 100) {
_this.complete();
}
}, this.interval);
};
SlimLoadingBarService.prototype.complete = function () {
var _this = this;
this.progress = 100;
this.stop();
setTimeout(function () {
// Hide it away
_this.visible = false;
setTimeout(function () {
// Drop to 0
_this.progress = 0;
}, 250);
}, 250); this.onCompleted();
}; SlimLoadingBarService.prototype.onCompleted = function () {
};
thanks for your giving!
The text was updated successfully, but these errors were encountered:
Code To:
SlimLoadingBarService.start(()=>{alert("complete!")});
When I run the code ,it start ok but can't get my completed status like the "complete!";
I check your slim-loading-bar.service.js code on [email protected].
it does not has the function to onComplete ,
then i fix it simple and the code is down:
SlimLoadingBarService.prototype.start = function (onCompleted) {
var _this = this;
if (onCompleted === void 0) {
onCompleted = null;
}else
this.onCompleted=onCompleted;
// Stop current timer
this.stop();
// Make it visible for sure
this.visible = true;
// Run the timer with milliseconds iterval
this._intervalCounterId = setInterval(function () {
// Increment the progress and update view component
_this.progress++;
// If the progress is 100% - call complete
if (_this.progress === 100) {
_this.complete();
}
}, this.interval);
};
SlimLoadingBarService.prototype.complete = function () {
var _this = this;
this.progress = 100;
this.stop();
setTimeout(function () {
// Hide it away
_this.visible = false;
setTimeout(function () {
// Drop to 0
_this.progress = 0;
}, 250);
}, 250);
this.onCompleted();
};
SlimLoadingBarService.prototype.onCompleted = function () {
};
thanks for your giving!
The text was updated successfully, but these errors were encountered: