Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ng-loading-bar

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-loading-bar - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

96

bundles/ng-loading-bar.umd.js

@@ -62,2 +62,4 @@ (function webpackUniversalModuleDefinition(root, factory) {

exports.NgLoadingBarHttp = loading_bar_http_1.NgLoadingBarHttp;
var loading_bar_component_1 = __webpack_require__(7);
exports.NgLoadingBarComponent = loading_bar_component_1.NgLoadingBarComponent;

@@ -90,21 +92,26 @@

}
NgLoadingBarModule.forRoot = function () {
return {
ngModule: NgLoadingBarModule,
providers: [
{ provide: http_1.Http, useFactory: httpFactory, deps: [http_1.XHRBackend, http_1.RequestOptions] },
],
};
};
NgLoadingBarModule = __decorate([
core_1.NgModule({
declarations: [
loading_bar_component_1.NgLoadingBarComponent,
],
imports: [
http_1.HttpModule,
],
exports: [
loading_bar_component_1.NgLoadingBarComponent,
],
}),
__metadata('design:paramtypes', [])
], NgLoadingBarModule);
return NgLoadingBarModule;
}());
NgLoadingBarModule = __decorate([
core_1.NgModule({
declarations: [
loading_bar_component_1.NgLoadingBarComponent,
],
imports: [
http_1.HttpModule,
],
providers: [
{ provide: http_1.Http, useFactory: httpFactory, deps: [http_1.XHRBackend, http_1.RequestOptions] },
],
exports: [
loading_bar_component_1.NgLoadingBarComponent,
],
}),
__metadata("design:paramtypes", [])
], NgLoadingBarModule);
exports.NgLoadingBarModule = NgLoadingBarModule;

@@ -151,6 +158,5 @@

function NgLoadingBarHttp() {
var _this = _super.apply(this, arguments) || this;
_this.pending = new Subject_1.Subject();
_this._pendingRequests = 0;
return _this;
_super.apply(this, arguments);
this.pending = new Subject_1.Subject();
this._pendingRequests = 0;
}

@@ -179,8 +185,8 @@ NgLoadingBarHttp.prototype.request = function (url, options) {

};
NgLoadingBarHttp = __decorate([
core_1.Injectable(),
__metadata('design:paramtypes', [])
], NgLoadingBarHttp);
return NgLoadingBarHttp;
}(http_1.Http));
NgLoadingBarHttp = __decorate([
core_1.Injectable(),
__metadata("design:paramtypes", [])
], NgLoadingBarHttp);
exports.NgLoadingBarHttp = NgLoadingBarHttp;

@@ -320,24 +326,24 @@

};
__decorate([
core_1.ViewChild('loadingBarSpinner'),
__metadata('design:type', Object)
], NgLoadingBarComponent.prototype, "_spinner", void 0);
__decorate([
core_1.ViewChild('loadingBarContainer'),
__metadata('design:type', Object)
], NgLoadingBarComponent.prototype, "_loadingBarContainer", void 0);
__decorate([
core_1.ViewChild('loadingBar'),
__metadata('design:type', Object)
], NgLoadingBarComponent.prototype, "_loadingBar", void 0);
NgLoadingBarComponent = __decorate([
core_1.Component({
selector: 'ng-loading-bar',
template: "\n <div id=\"loading-bar-spinner\" #loadingBarSpinner><div class=\"spinner-icon\"></div></div>\n <div id=\"loading-bar\" #loadingBarContainer><div class=\"bar\" #loadingBar><div class=\"peg\"></div></div></div>\n ",
}),
__param(1, core_1.Inject(http_1.Http)),
__metadata('design:paramtypes', [core_1.Renderer, loading_bar_http_1.NgLoadingBarHttp])
], NgLoadingBarComponent);
return NgLoadingBarComponent;
}());
__decorate([
core_1.ViewChild('loadingBarSpinner'),
__metadata("design:type", Object)
], NgLoadingBarComponent.prototype, "_spinner", void 0);
__decorate([
core_1.ViewChild('loadingBarContainer'),
__metadata("design:type", Object)
], NgLoadingBarComponent.prototype, "_loadingBarContainer", void 0);
__decorate([
core_1.ViewChild('loadingBar'),
__metadata("design:type", Object)
], NgLoadingBarComponent.prototype, "_loadingBar", void 0);
NgLoadingBarComponent = __decorate([
core_1.Component({
selector: 'ng-loading-bar',
template: "\n <div id=\"loading-bar-spinner\" #loadingBarSpinner><div class=\"spinner-icon\"></div></div>\n <div id=\"loading-bar\" #loadingBarContainer><div class=\"bar\" #loadingBar><div class=\"peg\"></div></div></div>\n ",
}),
__param(1, core_1.Inject(http_1.Http)),
__metadata("design:paramtypes", [core_1.Renderer, loading_bar_http_1.NgLoadingBarHttp])
], NgLoadingBarComponent);
exports.NgLoadingBarComponent = NgLoadingBarComponent;

@@ -344,0 +350,0 @@

@@ -1,2 +0,2 @@

(function webpackUniversalModuleDefinition(root,factory){if(typeof exports==="object"&&typeof module==="object")module.exports=factory(require("@angular/core"),require("@angular/http"),require("rxjs/Subject"),require("rxjs/add/operator/share"));else if(typeof define==="function"&&define.amd)define(["@angular/core","@angular/http","rxjs/Subject","rxjs/add/operator/share"],factory);else if(typeof exports==="object")exports["ng-loading-bar"]=factory(require("@angular/core"),require("@angular/http"),require("rxjs/Subject"),require("rxjs/add/operator/share"));else root["ng-loading-bar"]=factory(root["@angular/core"],root["@angular/http"],root["rxjs/Subject"],root["rxjs/add/operator/share"])})(this,function(__WEBPACK_EXTERNAL_MODULE_2__,__WEBPACK_EXTERNAL_MODULE_3__,__WEBPACK_EXTERNAL_MODULE_5__,__WEBPACK_EXTERNAL_MODULE_6__){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={exports:{},id:moduleId,loaded:false};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.loaded=true;return module.exports}__webpack_require__.m=modules;__webpack_require__.c=installedModules;__webpack_require__.p="";return __webpack_require__(0)}([function(module,exports,__webpack_require__){"use strict";var loading_bar_module_1=__webpack_require__(1);exports.NgLoadingBarModule=loading_bar_module_1.NgLoadingBarModule;var loading_bar_http_1=__webpack_require__(4);exports.NgLoadingBarHttp=loading_bar_http_1.NgLoadingBarHttp},function(module,exports,__webpack_require__){"use strict";var __decorate=this&&this.__decorate||function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)if(d=decorators[i])r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r;return c>3&&r&&Object.defineProperty(target,key,r),r};var __metadata=this&&this.__metadata||function(k,v){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(k,v)};var core_1=__webpack_require__(2);var http_1=__webpack_require__(3);var loading_bar_http_1=__webpack_require__(4);var loading_bar_component_1=__webpack_require__(7);function httpFactory(xhrBackend,requestOptions){return new loading_bar_http_1.NgLoadingBarHttp(xhrBackend,requestOptions)}exports.httpFactory=httpFactory;var NgLoadingBarModule=function(){function NgLoadingBarModule(){}return NgLoadingBarModule}();NgLoadingBarModule=__decorate([core_1.NgModule({declarations:[loading_bar_component_1.NgLoadingBarComponent],imports:[http_1.HttpModule],providers:[{provide:http_1.Http,useFactory:httpFactory,deps:[http_1.XHRBackend,http_1.RequestOptions]}],exports:[loading_bar_component_1.NgLoadingBarComponent]}),__metadata("design:paramtypes",[])],NgLoadingBarModule);exports.NgLoadingBarModule=NgLoadingBarModule},function(module,exports){module.exports=__WEBPACK_EXTERNAL_MODULE_2__},function(module,exports){module.exports=__WEBPACK_EXTERNAL_MODULE_3__},function(module,exports,__webpack_require__){"use strict";var __extends=this&&this.__extends||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p];function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)};var __decorate=this&&this.__decorate||function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)if(d=decorators[i])r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r;return c>3&&r&&Object.defineProperty(target,key,r),r};var __metadata=this&&this.__metadata||function(k,v){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(k,v)};var http_1=__webpack_require__(3);var core_1=__webpack_require__(2);var Subject_1=__webpack_require__(5);__webpack_require__(6);var NgLoadingBarHttp=function(_super){__extends(NgLoadingBarHttp,_super);function NgLoadingBarHttp(){var _this=_super.apply(this,arguments)||this;_this.pending=new Subject_1.Subject;_this._pendingRequests=0;return _this}NgLoadingBarHttp.prototype.request=function(url,options){var _this=this;var response=_super.prototype.request.call(this,url,options).share();if(options&&options.ignoreLoadingBar===true){return response}this.requestStarted();response.subscribe(function(x){},function(err){return _this.requestEnded()},function(){return _this.requestEnded()});return response};NgLoadingBarHttp.prototype.requestStarted=function(){this.pending.next({started:this._pendingRequests===0,pendingRequests:++this._pendingRequests})};NgLoadingBarHttp.prototype.requestEnded=function(){this.pending.next({completed:this._pendingRequests===1,pendingRequests:--this._pendingRequests})};return NgLoadingBarHttp}(http_1.Http);NgLoadingBarHttp=__decorate([core_1.Injectable(),__metadata("design:paramtypes",[])],NgLoadingBarHttp);exports.NgLoadingBarHttp=NgLoadingBarHttp},function(module,exports){module.exports=__WEBPACK_EXTERNAL_MODULE_5__},function(module,exports){module.exports=__WEBPACK_EXTERNAL_MODULE_6__},function(module,exports,__webpack_require__){"use strict";var __decorate=this&&this.__decorate||function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)if(d=decorators[i])r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r;return c>3&&r&&Object.defineProperty(target,key,r),r};var __metadata=this&&this.__metadata||function(k,v){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(k,v)};var __param=this&&this.__param||function(paramIndex,decorator){return function(target,key){decorator(target,key,paramIndex)}};var core_1=__webpack_require__(2);var http_1=__webpack_require__(3);var loading_bar_http_1=__webpack_require__(4);var NgLoadingBarComponent=function(){function NgLoadingBarComponent(_renderer,http){var _this=this;this._renderer=_renderer;this._autoIncrement=true;this._includeSpinner=true;this._includeBar=true;this._latencyThreshold=10;this._startSize=.02;this._started=false;this._status=0;http.pending.subscribe(function(progress){if(progress.started)_this.start();if(progress.completed)_this.complete()})}NgLoadingBarComponent.prototype.ngAfterViewInit=function(){this.hide(this._loadingBarContainer);this.hide(this._spinner)};NgLoadingBarComponent.prototype.start=function(){var _this=this;this._startTimeout=setTimeout(function(){clearTimeout(_this._completeTimeout);if(_this._started){return}_this._started=true;_this._status=0;if(_this._includeBar){_this.show(_this._loadingBarContainer)}if(_this._includeSpinner){_this.show(_this._spinner)}_this.set(_this._startSize)},this._latencyThreshold)};NgLoadingBarComponent.prototype.set=function(n){var _this=this;if(!this._started){return}var pct=n*100+"%";this.setElementStyle(this._loadingBar,"width",pct);this._status=n;if(this._autoIncrement){clearTimeout(this._incTimeout);this._incTimeout=setTimeout(function(){_this.inc()},250)}};NgLoadingBarComponent.prototype.complete=function(){var _this=this;this.set(1);clearTimeout(this._completeTimeout);clearTimeout(this._startTimeout);this._completeTimeout=setTimeout(function(){_this._started=false;_this.hide(_this._loadingBarContainer);_this.hide(_this._spinner)},500)};NgLoadingBarComponent.prototype.inc=function(){if(this._status>=1){return}var rnd=0;var stat=this._status;if(stat>=0&&stat<.25){rnd=(Math.random()*(5-3+1)+3)/100}else if(stat>=.25&&stat<.65){rnd=Math.random()*3/100}else if(stat>=.65&&stat<.9){rnd=Math.random()*2/100}else if(stat>=.9&&stat<.99){rnd=.005}else{rnd=0}var pct=this._status+rnd;this.set(pct)};NgLoadingBarComponent.prototype.show=function(el){this.setElementStyle(el,"display","block")};NgLoadingBarComponent.prototype.hide=function(el){this.setElementStyle(el,"display","none")};NgLoadingBarComponent.prototype.setElementStyle=function(el,styleName,styleValue){this._renderer.setElementStyle(el.nativeElement,styleName,styleValue)};return NgLoadingBarComponent}();__decorate([core_1.ViewChild("loadingBarSpinner"),__metadata("design:type",Object)],NgLoadingBarComponent.prototype,"_spinner",void 0);__decorate([core_1.ViewChild("loadingBarContainer"),__metadata("design:type",Object)],NgLoadingBarComponent.prototype,"_loadingBarContainer",void 0);__decorate([core_1.ViewChild("loadingBar"),__metadata("design:type",Object)],NgLoadingBarComponent.prototype,"_loadingBar",void 0);NgLoadingBarComponent=__decorate([core_1.Component({selector:"ng-loading-bar",template:'\n <div id="loading-bar-spinner" #loadingBarSpinner><div class="spinner-icon"></div></div>\n <div id="loading-bar" #loadingBarContainer><div class="bar" #loadingBar><div class="peg"></div></div></div>\n '}),__param(1,core_1.Inject(http_1.Http)),__metadata("design:paramtypes",[core_1.Renderer,loading_bar_http_1.NgLoadingBarHttp])],NgLoadingBarComponent);exports.NgLoadingBarComponent=NgLoadingBarComponent}])});
(function webpackUniversalModuleDefinition(root,factory){if(typeof exports==="object"&&typeof module==="object")module.exports=factory(require("@angular/core"),require("@angular/http"),require("rxjs/Subject"),require("rxjs/add/operator/share"));else if(typeof define==="function"&&define.amd)define(["@angular/core","@angular/http","rxjs/Subject","rxjs/add/operator/share"],factory);else if(typeof exports==="object")exports["ng-loading-bar"]=factory(require("@angular/core"),require("@angular/http"),require("rxjs/Subject"),require("rxjs/add/operator/share"));else root["ng-loading-bar"]=factory(root["@angular/core"],root["@angular/http"],root["rxjs/Subject"],root["rxjs/add/operator/share"])})(this,function(__WEBPACK_EXTERNAL_MODULE_2__,__WEBPACK_EXTERNAL_MODULE_3__,__WEBPACK_EXTERNAL_MODULE_5__,__WEBPACK_EXTERNAL_MODULE_6__){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={exports:{},id:moduleId,loaded:false};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.loaded=true;return module.exports}__webpack_require__.m=modules;__webpack_require__.c=installedModules;__webpack_require__.p="";return __webpack_require__(0)}([function(module,exports,__webpack_require__){"use strict";var loading_bar_module_1=__webpack_require__(1);exports.NgLoadingBarModule=loading_bar_module_1.NgLoadingBarModule;var loading_bar_http_1=__webpack_require__(4);exports.NgLoadingBarHttp=loading_bar_http_1.NgLoadingBarHttp;var loading_bar_component_1=__webpack_require__(7);exports.NgLoadingBarComponent=loading_bar_component_1.NgLoadingBarComponent},function(module,exports,__webpack_require__){"use strict";var __decorate=this&&this.__decorate||function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)if(d=decorators[i])r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r;return c>3&&r&&Object.defineProperty(target,key,r),r};var __metadata=this&&this.__metadata||function(k,v){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(k,v)};var core_1=__webpack_require__(2);var http_1=__webpack_require__(3);var loading_bar_http_1=__webpack_require__(4);var loading_bar_component_1=__webpack_require__(7);function httpFactory(xhrBackend,requestOptions){return new loading_bar_http_1.NgLoadingBarHttp(xhrBackend,requestOptions)}exports.httpFactory=httpFactory;var NgLoadingBarModule=function(){function NgLoadingBarModule(){}NgLoadingBarModule.forRoot=function(){return{ngModule:NgLoadingBarModule,providers:[{provide:http_1.Http,useFactory:httpFactory,deps:[http_1.XHRBackend,http_1.RequestOptions]}]}};NgLoadingBarModule=__decorate([core_1.NgModule({declarations:[loading_bar_component_1.NgLoadingBarComponent],imports:[http_1.HttpModule],exports:[loading_bar_component_1.NgLoadingBarComponent]}),__metadata("design:paramtypes",[])],NgLoadingBarModule);return NgLoadingBarModule}();exports.NgLoadingBarModule=NgLoadingBarModule},function(module,exports){module.exports=__WEBPACK_EXTERNAL_MODULE_2__},function(module,exports){module.exports=__WEBPACK_EXTERNAL_MODULE_3__},function(module,exports,__webpack_require__){"use strict";var __extends=this&&this.__extends||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p];function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)};var __decorate=this&&this.__decorate||function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)if(d=decorators[i])r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r;return c>3&&r&&Object.defineProperty(target,key,r),r};var __metadata=this&&this.__metadata||function(k,v){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(k,v)};var http_1=__webpack_require__(3);var core_1=__webpack_require__(2);var Subject_1=__webpack_require__(5);__webpack_require__(6);var NgLoadingBarHttp=function(_super){__extends(NgLoadingBarHttp,_super);function NgLoadingBarHttp(){_super.apply(this,arguments);this.pending=new Subject_1.Subject;this._pendingRequests=0}NgLoadingBarHttp.prototype.request=function(url,options){var _this=this;var response=_super.prototype.request.call(this,url,options).share();if(options&&options.ignoreLoadingBar===true){return response}this.requestStarted();response.subscribe(function(x){},function(err){return _this.requestEnded()},function(){return _this.requestEnded()});return response};NgLoadingBarHttp.prototype.requestStarted=function(){this.pending.next({started:this._pendingRequests===0,pendingRequests:++this._pendingRequests})};NgLoadingBarHttp.prototype.requestEnded=function(){this.pending.next({completed:this._pendingRequests===1,pendingRequests:--this._pendingRequests})};NgLoadingBarHttp=__decorate([core_1.Injectable(),__metadata("design:paramtypes",[])],NgLoadingBarHttp);return NgLoadingBarHttp}(http_1.Http);exports.NgLoadingBarHttp=NgLoadingBarHttp},function(module,exports){module.exports=__WEBPACK_EXTERNAL_MODULE_5__},function(module,exports){module.exports=__WEBPACK_EXTERNAL_MODULE_6__},function(module,exports,__webpack_require__){"use strict";var __decorate=this&&this.__decorate||function(decorators,target,key,desc){var c=arguments.length,r=c<3?target:desc===null?desc=Object.getOwnPropertyDescriptor(target,key):desc,d;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)if(d=decorators[i])r=(c<3?d(r):c>3?d(target,key,r):d(target,key))||r;return c>3&&r&&Object.defineProperty(target,key,r),r};var __metadata=this&&this.__metadata||function(k,v){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(k,v)};var __param=this&&this.__param||function(paramIndex,decorator){return function(target,key){decorator(target,key,paramIndex)}};var core_1=__webpack_require__(2);var http_1=__webpack_require__(3);var loading_bar_http_1=__webpack_require__(4);var NgLoadingBarComponent=function(){function NgLoadingBarComponent(_renderer,http){var _this=this;this._renderer=_renderer;this._autoIncrement=true;this._includeSpinner=true;this._includeBar=true;this._latencyThreshold=10;this._startSize=.02;this._started=false;this._status=0;http.pending.subscribe(function(progress){if(progress.started)_this.start();if(progress.completed)_this.complete()})}NgLoadingBarComponent.prototype.ngAfterViewInit=function(){this.hide(this._loadingBarContainer);this.hide(this._spinner)};NgLoadingBarComponent.prototype.start=function(){var _this=this;this._startTimeout=setTimeout(function(){clearTimeout(_this._completeTimeout);if(_this._started){return}_this._started=true;_this._status=0;if(_this._includeBar){_this.show(_this._loadingBarContainer)}if(_this._includeSpinner){_this.show(_this._spinner)}_this.set(_this._startSize)},this._latencyThreshold)};NgLoadingBarComponent.prototype.set=function(n){var _this=this;if(!this._started){return}var pct=n*100+"%";this.setElementStyle(this._loadingBar,"width",pct);this._status=n;if(this._autoIncrement){clearTimeout(this._incTimeout);this._incTimeout=setTimeout(function(){_this.inc()},250)}};NgLoadingBarComponent.prototype.complete=function(){var _this=this;this.set(1);clearTimeout(this._completeTimeout);clearTimeout(this._startTimeout);this._completeTimeout=setTimeout(function(){_this._started=false;_this.hide(_this._loadingBarContainer);_this.hide(_this._spinner)},500)};NgLoadingBarComponent.prototype.inc=function(){if(this._status>=1){return}var rnd=0;var stat=this._status;if(stat>=0&&stat<.25){rnd=(Math.random()*(5-3+1)+3)/100}else if(stat>=.25&&stat<.65){rnd=Math.random()*3/100}else if(stat>=.65&&stat<.9){rnd=Math.random()*2/100}else if(stat>=.9&&stat<.99){rnd=.005}else{rnd=0}var pct=this._status+rnd;this.set(pct)};NgLoadingBarComponent.prototype.show=function(el){this.setElementStyle(el,"display","block")};NgLoadingBarComponent.prototype.hide=function(el){this.setElementStyle(el,"display","none")};NgLoadingBarComponent.prototype.setElementStyle=function(el,styleName,styleValue){this._renderer.setElementStyle(el.nativeElement,styleName,styleValue)};__decorate([core_1.ViewChild("loadingBarSpinner"),__metadata("design:type",Object)],NgLoadingBarComponent.prototype,"_spinner",void 0);__decorate([core_1.ViewChild("loadingBarContainer"),__metadata("design:type",Object)],NgLoadingBarComponent.prototype,"_loadingBarContainer",void 0);__decorate([core_1.ViewChild("loadingBar"),__metadata("design:type",Object)],NgLoadingBarComponent.prototype,"_loadingBar",void 0);NgLoadingBarComponent=__decorate([core_1.Component({selector:"ng-loading-bar",template:'\n <div id="loading-bar-spinner" #loadingBarSpinner><div class="spinner-icon"></div></div>\n <div id="loading-bar" #loadingBarContainer><div class="bar" #loadingBar><div class="peg"></div></div></div>\n '}),__param(1,core_1.Inject(http_1.Http)),__metadata("design:paramtypes",[core_1.Renderer,loading_bar_http_1.NgLoadingBarHttp])],NgLoadingBarComponent);return NgLoadingBarComponent}();exports.NgLoadingBarComponent=NgLoadingBarComponent}])});
//# sourceMappingURL=bundles/ng-loading-bar.umd.min.js.map
import { NgLoadingBarModule } from './loading-bar.module';
import { NgLoadingBarHttp } from './loading-bar.http';
export { NgLoadingBarModule, NgLoadingBarHttp };
import { NgLoadingBarComponent } from './loading-bar.component';
export { NgLoadingBarModule, NgLoadingBarHttp, NgLoadingBarComponent };
import { NgLoadingBarModule } from './loading-bar.module';
import { NgLoadingBarHttp } from './loading-bar.http';
export { NgLoadingBarModule, NgLoadingBarHttp, };
//# sourceMappingURL=index.js.map
import { NgLoadingBarComponent } from './loading-bar.component';
export { NgLoadingBarModule, NgLoadingBarHttp, NgLoadingBarComponent };

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":3,"metadata":{"NgLoadingBarModule":{"__symbolic":"reference","module":"./loading-bar.module","name":"NgLoadingBarModule"},"NgLoadingBarHttp":{"__symbolic":"reference","module":"./loading-bar.http","name":"NgLoadingBarHttp"}}},{"__symbolic":"module","version":1,"metadata":{"NgLoadingBarModule":{"__symbolic":"reference","module":"./loading-bar.module","name":"NgLoadingBarModule"},"NgLoadingBarHttp":{"__symbolic":"reference","module":"./loading-bar.http","name":"NgLoadingBarHttp"}}}]
[{"__symbolic":"module","version":3,"metadata":{"NgLoadingBarModule":{"__symbolic":"reference","module":"./loading-bar.module","name":"NgLoadingBarModule"},"NgLoadingBarHttp":{"__symbolic":"reference","module":"./loading-bar.http","name":"NgLoadingBarHttp"},"NgLoadingBarComponent":{"__symbolic":"reference","module":"./loading-bar.component","name":"NgLoadingBarComponent"}}},{"__symbolic":"module","version":1,"metadata":{"NgLoadingBarModule":{"__symbolic":"reference","module":"./loading-bar.module","name":"NgLoadingBarModule"},"NgLoadingBarHttp":{"__symbolic":"reference","module":"./loading-bar.http","name":"NgLoadingBarHttp"},"NgLoadingBarComponent":{"__symbolic":"reference","module":"./loading-bar.component","name":"NgLoadingBarComponent"}}}]

@@ -1,17 +0,5 @@

var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
import { Inject, Component, ViewChild, Renderer } from '@angular/core';
import { Http } from '@angular/http';
import { NgLoadingBarHttp } from './loading-bar.http';
var NgLoadingBarComponent = (function () {
export var NgLoadingBarComponent = (function () {
function NgLoadingBarComponent(_renderer, http) {

@@ -115,25 +103,18 @@ var _this = this;

};
NgLoadingBarComponent.decorators = [
{ type: Component, args: [{
selector: 'ng-loading-bar',
template: "\n <div id=\"loading-bar-spinner\" #loadingBarSpinner><div class=\"spinner-icon\"></div></div>\n <div id=\"loading-bar\" #loadingBarContainer><div class=\"bar\" #loadingBar><div class=\"peg\"></div></div></div>\n ",
},] },
];
NgLoadingBarComponent.ctorParameters = function () { return [
{ type: Renderer, },
{ type: NgLoadingBarHttp, decorators: [{ type: Inject, args: [Http,] },] },
]; };
NgLoadingBarComponent.propDecorators = {
'_spinner': [{ type: ViewChild, args: ['loadingBarSpinner',] },],
'_loadingBarContainer': [{ type: ViewChild, args: ['loadingBarContainer',] },],
'_loadingBar': [{ type: ViewChild, args: ['loadingBar',] },],
};
return NgLoadingBarComponent;
}());
__decorate([
ViewChild('loadingBarSpinner'),
__metadata("design:type", Object)
], NgLoadingBarComponent.prototype, "_spinner", void 0);
__decorate([
ViewChild('loadingBarContainer'),
__metadata("design:type", Object)
], NgLoadingBarComponent.prototype, "_loadingBarContainer", void 0);
__decorate([
ViewChild('loadingBar'),
__metadata("design:type", Object)
], NgLoadingBarComponent.prototype, "_loadingBar", void 0);
NgLoadingBarComponent = __decorate([
Component({
selector: 'ng-loading-bar',
template: "\n <div id=\"loading-bar-spinner\" #loadingBarSpinner><div class=\"spinner-icon\"></div></div>\n <div id=\"loading-bar\" #loadingBarContainer><div class=\"bar\" #loadingBar><div class=\"peg\"></div></div></div>\n ",
}),
__param(1, Inject(Http)),
__metadata("design:paramtypes", [Renderer, NgLoadingBarHttp])
], NgLoadingBarComponent);
export { NgLoadingBarComponent };
//# sourceMappingURL=loading-bar.component.js.map

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":3,"metadata":{"NgLoadingBarComponent":{"__symbolic":"error","message":"Reference to a local symbol","line":11,"character":13,"context":{"name":"NgLoadingBarComponent"}}}},{"__symbolic":"module","version":1,"metadata":{"NgLoadingBarComponent":{"__symbolic":"error","message":"Reference to a local symbol","line":11,"character":13,"context":{"name":"NgLoadingBarComponent"}}}}]
[{"__symbolic":"module","version":3,"metadata":{"NgLoadingBarComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ng-loading-bar","template":"\n <div id=\"loading-bar-spinner\" #loadingBarSpinner><div class=\"spinner-icon\"></div></div>\n <div id=\"loading-bar\" #loadingBarContainer><div class=\"bar\" #loadingBar><div class=\"peg\"></div></div></div>\n "}]}],"members":{"_spinner":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild"},"arguments":["loadingBarSpinner"]}]}],"_loadingBarContainer":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild"},"arguments":["loadingBarContainer"]}]}],"_loadingBar":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild"},"arguments":["loadingBar"]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"@angular/http","name":"Http"}]}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer"},{"__symbolic":"reference","module":"./loading-bar.http","name":"NgLoadingBarHttp"}]}],"ngAfterViewInit":[{"__symbolic":"method"}],"start":[{"__symbolic":"method"}],"set":[{"__symbolic":"method"}],"complete":[{"__symbolic":"method"}],"inc":[{"__symbolic":"method"}],"show":[{"__symbolic":"method"}],"hide":[{"__symbolic":"method"}],"setElementStyle":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"NgLoadingBarComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ng-loading-bar","template":"\n <div id=\"loading-bar-spinner\" #loadingBarSpinner><div class=\"spinner-icon\"></div></div>\n <div id=\"loading-bar\" #loadingBarContainer><div class=\"bar\" #loadingBar><div class=\"peg\"></div></div></div>\n "}]}],"members":{"_spinner":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild"},"arguments":["loadingBarSpinner"]}]}],"_loadingBarContainer":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild"},"arguments":["loadingBarContainer"]}]}],"_loadingBar":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild"},"arguments":["loadingBar"]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject"},"arguments":[{"__symbolic":"reference","module":"@angular/http","name":"Http"}]}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer"},{"__symbolic":"reference","module":"./loading-bar.http","name":"NgLoadingBarHttp"}]}],"ngAfterViewInit":[{"__symbolic":"method"}],"start":[{"__symbolic":"method"}],"set":[{"__symbolic":"method"}],"complete":[{"__symbolic":"method"}],"inc":[{"__symbolic":"method"}],"show":[{"__symbolic":"method"}],"hide":[{"__symbolic":"method"}],"setElementStyle":[{"__symbolic":"method"}]}}}}]

@@ -6,11 +6,2 @@ var __extends = (this && this.__extends) || function (d, b) {

};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { Http } from '@angular/http';

@@ -20,9 +11,8 @@ import { Injectable } from '@angular/core';

import 'rxjs/add/operator/share';
var NgLoadingBarHttp = (function (_super) {
export var NgLoadingBarHttp = (function (_super) {
__extends(NgLoadingBarHttp, _super);
function NgLoadingBarHttp() {
var _this = _super.apply(this, arguments) || this;
_this.pending = new Subject();
_this._pendingRequests = 0;
return _this;
_super.apply(this, arguments);
this.pending = new Subject();
this._pendingRequests = 0;
}

@@ -51,9 +41,7 @@ NgLoadingBarHttp.prototype.request = function (url, options) {

};
NgLoadingBarHttp.decorators = [
{ type: Injectable },
];
NgLoadingBarHttp.ctorParameters = function () { return []; };
return NgLoadingBarHttp;
}(Http));
NgLoadingBarHttp = __decorate([
Injectable(),
__metadata("design:paramtypes", [])
], NgLoadingBarHttp);
export { NgLoadingBarHttp };
//# sourceMappingURL=loading-bar.http.js.map

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":3,"metadata":{"NgLoadingBarHttp":{"__symbolic":"error","message":"Reference to a local symbol","line":12,"character":13,"context":{"name":"NgLoadingBarHttp"}}}},{"__symbolic":"module","version":1,"metadata":{"NgLoadingBarHttp":{"__symbolic":"error","message":"Reference to a local symbol","line":12,"character":13,"context":{"name":"NgLoadingBarHttp"}}}}]
[{"__symbolic":"module","version":3,"metadata":{"NgLoadingBarHttp":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/http","name":"Http"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"request":[{"__symbolic":"method"}],"requestStarted":[{"__symbolic":"method"}],"requestEnded":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"NgLoadingBarHttp":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@angular/http","name":"Http"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"request":[{"__symbolic":"method"}],"requestStarted":[{"__symbolic":"method"}],"requestEnded":[{"__symbolic":"method"}]}}}}]

@@ -0,4 +1,6 @@

import { ModuleWithProviders } from '@angular/core';
import { Http, XHRBackend, RequestOptions } from '@angular/http';
export declare function httpFactory(xhrBackend: XHRBackend, requestOptions: RequestOptions): Http;
export declare class NgLoadingBarModule {
static forRoot(): ModuleWithProviders;
}

@@ -1,10 +0,1 @@

var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { NgModule } from '@angular/core';

@@ -17,25 +8,28 @@ import { HttpModule, Http, XHRBackend, RequestOptions } from '@angular/http';

}
var NgLoadingBarModule = (function () {
export var NgLoadingBarModule = (function () {
function NgLoadingBarModule() {
}
NgLoadingBarModule.forRoot = function () {
return {
ngModule: NgLoadingBarModule,
providers: [
{ provide: Http, useFactory: httpFactory, deps: [XHRBackend, RequestOptions] },
],
};
};
NgLoadingBarModule.decorators = [
{ type: NgModule, args: [{
declarations: [
NgLoadingBarComponent,
],
imports: [
HttpModule,
],
exports: [
NgLoadingBarComponent,
],
},] },
];
NgLoadingBarModule.ctorParameters = function () { return []; };
return NgLoadingBarModule;
}());
NgLoadingBarModule = __decorate([
NgModule({
declarations: [
NgLoadingBarComponent,
],
imports: [
HttpModule,
],
providers: [
{ provide: Http, useFactory: httpFactory, deps: [XHRBackend, RequestOptions] },
],
exports: [
NgLoadingBarComponent,
],
}),
__metadata("design:paramtypes", [])
], NgLoadingBarModule);
export { NgLoadingBarModule };
//# sourceMappingURL=loading-bar.module.js.map

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":3,"metadata":{"NgLoadingBarModule":{"__symbolic":"error","message":"Reference to a local symbol","line":23,"character":13,"context":{"name":"NgLoadingBarModule"}}}},{"__symbolic":"module","version":1,"metadata":{"NgLoadingBarModule":{"__symbolic":"error","message":"Reference to a local symbol","line":23,"character":13,"context":{"name":"NgLoadingBarModule"}}}}]
[{"__symbolic":"module","version":3,"metadata":{"httpFactory":{"__symbolic":"function","parameters":["xhrBackend","requestOptions"],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"./loading-bar.http","name":"NgLoadingBarHttp"},"arguments":[{"__symbolic":"reference","name":"xhrBackend"},{"__symbolic":"reference","name":"requestOptions"}]}},"NgLoadingBarModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./loading-bar.component","name":"NgLoadingBarComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/http","name":"HttpModule"}],"exports":[{"__symbolic":"reference","module":"./loading-bar.component","name":"NgLoadingBarComponent"}]}]}],"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"NgLoadingBarModule"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/http","name":"Http"},"useFactory":{"__symbolic":"reference","name":"httpFactory"},"deps":[{"__symbolic":"reference","module":"@angular/http","name":"XHRBackend"},{"__symbolic":"reference","module":"@angular/http","name":"RequestOptions"}]}]}}}}}},{"__symbolic":"module","version":1,"metadata":{"httpFactory":{"__symbolic":"function","parameters":["xhrBackend","requestOptions"],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"./loading-bar.http","name":"NgLoadingBarHttp"},"arguments":[{"__symbolic":"reference","name":"xhrBackend"},{"__symbolic":"reference","name":"requestOptions"}]}},"NgLoadingBarModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./loading-bar.component","name":"NgLoadingBarComponent"}],"imports":[{"__symbolic":"reference","module":"@angular/http","name":"HttpModule"}],"exports":[{"__symbolic":"reference","module":"./loading-bar.component","name":"NgLoadingBarComponent"}]}]}],"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"NgLoadingBarModule"},"providers":[{"provide":{"__symbolic":"reference","module":"@angular/http","name":"Http"},"useFactory":{"__symbolic":"reference","name":"httpFactory"},"deps":[{"__symbolic":"reference","module":"@angular/http","name":"XHRBackend"},{"__symbolic":"reference","module":"@angular/http","name":"RequestOptions"}]}]}}}}}}]
{
"name": "ng-loading-bar",
"version": "0.0.3",
"version": "0.0.4",
"main": "bundles/ng-loading-bar.umd.js",

@@ -35,3 +35,3 @@ "module": "lib/index.js",

"@angular/core": "^2.3.1",
"@angular/forms": "^2.2.3",
"@angular/forms": "^2.3.1",
"@angular/http": "^2.3.1",

@@ -67,3 +67,3 @@ "@angular/platform-browser": "^2.3.1",

"tslint": "^4.0.2",
"typescript": "^2.0.7",
"typescript": "2.0.10",
"uglify-js": "^2.7.5",

@@ -70,0 +70,0 @@ "webpack": "^1.13.3",

@@ -21,3 +21,3 @@ ## Quick Start

HttpModule,
NgLoadingBarModule,
NgLoadingBarModule.forRoot(),
],

@@ -50,4 +50,3 @@ declarations: [ AppComponent ],

- `loading-bar.css`
Based on https://github.com/sir-valentin/Angular2LoadingBar.git
import { NgLoadingBarModule } from './loading-bar.module';
import { NgLoadingBarHttp } from './loading-bar.http';
import { NgLoadingBarComponent } from './loading-bar.component';

@@ -7,2 +8,3 @@ export {

NgLoadingBarHttp,
NgLoadingBarComponent,
}

@@ -1,2 +0,2 @@

import { NgModule } from '@angular/core';
import { NgModule, ModuleWithProviders } from '@angular/core';
import { HttpModule, Http, XHRBackend, RequestOptions } from '@angular/http';

@@ -17,5 +17,2 @@ import { NgLoadingBarHttp } from './loading-bar.http';

],
providers: [
{ provide: Http, useFactory: httpFactory, deps: [XHRBackend, RequestOptions] },
],
exports: [

@@ -25,2 +22,11 @@ NgLoadingBarComponent,

})
export class NgLoadingBarModule {}
export class NgLoadingBarModule {
static forRoot(): ModuleWithProviders {
return {
ngModule: NgLoadingBarModule,
providers: [
{ provide: Http, useFactory: httpFactory, deps: [XHRBackend, RequestOptions] },
],
};
}
}

@@ -7,3 +7,2 @@ {

"declaration": true,
"sourceMap": true,
"emitDecoratorMetadata": true,

@@ -24,5 +23,5 @@ "experimentalDecorators": true,

"angularCompilerOptions": {
"genDir": "lib",
"skipTemplateCodegen": true,
"strictMetadataEmit": true
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc