diff --git a/bundles/ng2-slim-loading-bar.min.js b/bundles/ng2-slim-loading-bar.min.js index 84ef389..e45357b 100644 --- a/bundles/ng2-slim-loading-bar.min.js +++ b/bundles/ng2-slim-loading-bar.min.js @@ -1,2 +1,2 @@ -System.registerDynamic("src/component",["@angular/core","@angular/common/src/facade/lang","@angular/common","./service"],!0,function(e,t,r){"use strict";var i=this&&this.__decorate||function(e,t,r,i){var n,o=arguments.length,s=3>o?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(3>o?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},n=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},o=e("@angular/core"),s=e("@angular/common/src/facade/lang"),a=e("@angular/common"),c=e("./service"),l=function(){function e(e){this.service=e,this._progress="0%",this.color="firebrick",this.height="2px",this.show=!0}return Object.defineProperty(e.prototype,"progress",{get:function(){return this._progress},set:function(e){s.isPresent(e)&&(this._progress=e+"%")},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.service.observable.subscribe(function(t){t.type===c.SlimLoadingBarEventType.PROGRESS?e.progress=t.value:t.type===c.SlimLoadingBarEventType.COLOR?e.color=t.value:t.type===c.SlimLoadingBarEventType.HEIGHT?e.height=t.value:t.type===c.SlimLoadingBarEventType.VISIBLE&&(e.show=t.value)})},i([o.Input(),n("design:type",String),n("design:paramtypes",[String])],e.prototype,"progress",null),i([o.Input(),n("design:type",String)],e.prototype,"color",void 0),i([o.Input(),n("design:type",String)],e.prototype,"height",void 0),i([o.Input(),n("design:type",Boolean)],e.prototype,"show",void 0),e=i([o.Component({selector:"ng2-slim-loading-bar",directives:[a.CORE_DIRECTIVES],template:'\n
\n
\n
'}),n("design:paramtypes",[c.SlimLoadingBarService])],e)}();return t.SlimLoadingBar=l,r.exports}),System.registerDynamic("src/service",["@angular/core","@angular/common/src/facade/lang","rxjs/Observable"],!0,function(e,t,r){"use strict";var i=this&&this.__decorate||function(e,t,r,i){var n,o=arguments.length,s=3>o?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(3>o?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},n=this&&this.__metadata||function(e,t){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(e,t):void 0},o=e("@angular/core"),s=e("@angular/common/src/facade/lang"),a=e("rxjs/Observable");!function(e){e[e.PROGRESS=0]="PROGRESS",e[e.HEIGHT=1]="HEIGHT",e[e.COLOR=2]="COLOR",e[e.VISIBLE=3]="VISIBLE"}(t.SlimLoadingBarEventType||(t.SlimLoadingBarEventType={}));var c=t.SlimLoadingBarEventType,l=function(){function e(e,t){this.type=e,this.value=t}return e}();t.SlimLoadingBarEvent=l;var p=function(){function e(){var e=this;this._progress=0,this._height="2px",this._color="firebrick",this._visible=!0,this._intervalCounterId=0,this.interval=500,this.observable=new a.Observable(function(t){e.subscriber=t})}return Object.defineProperty(e.prototype,"progress",{get:function(){return this._progress},set:function(e){s.isPresent(e)&&(e>0&&(this.visible=!0),this._progress=e,this.emitEvent(new l(c.PROGRESS,this._progress)))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(e){s.isPresent(e)&&(this._height=e,this.emitEvent(new l(c.HEIGHT,this._height)))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this._color},set:function(e){s.isPresent(e)&&(this._color=e,this.emitEvent(new l(c.COLOR,this._color)))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"visible",{get:function(){return this._visible},set:function(e){s.isPresent(e)&&(this._visible=e,this.emitEvent(new l(c.VISIBLE,this._visible)))},enumerable:!0,configurable:!0}),e.prototype.emitEvent=function(e){try{this.subscriber.next(e)}catch(t){console.log("!!! Suggestion: Seems you forget add into your html?")}},e.prototype.start=function(e){var t=this;void 0===e&&(e=null),this.stop(),this.visible=!0,this._intervalCounterId=setInterval(function(){t.progress++,100===t.progress&&t.complete()},this.interval)},e.prototype.stop=function(){this._intervalCounterId&&(clearInterval(this._intervalCounterId),this._intervalCounterId=null)},e.prototype.reset=function(){this.stop(),this.progress=0},e.prototype.complete=function(){var e=this;this.progress=100,this.stop(),setTimeout(function(){e.visible=!1,setTimeout(function(){e.progress=0},250)},250)},e=i([o.Injectable(),n("design:paramtypes",[])],e)}();return t.SlimLoadingBarService=p,r.exports}),System.registerDynamic("ng2-slim-loading-bar",["./src/component","./src/service"],!0,function(e,t,r){"use strict";function i(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}var n=e("./src/component"),o=e("./src/service");return i(e("./src/component")),i(e("./src/service")),Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={providers:[o.SlimLoadingBarService],directives:[n.SlimLoadingBar]},r.exports}); +System.registerDynamic("src/component",["@angular/core","@angular/common/src/facade/lang","@angular/common","./service"],!0,function(e,t,r){"use strict";var i=this&&this.__decorate||function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},n=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=e("@angular/core"),s=e("@angular/common/src/facade/lang"),a=e("@angular/common"),c=e("./service"),l=function(){function e(e){this.service=e,this._progress="0%",this.color="firebrick",this.height="2px",this.show=!0}return Object.defineProperty(e.prototype,"progress",{get:function(){return this._progress},set:function(e){s.isPresent(e)&&(this._progress=e+"%")},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.service.observable.subscribe(function(t){t.type===c.SlimLoadingBarEventType.PROGRESS?e.progress=t.value:t.type===c.SlimLoadingBarEventType.COLOR?e.color=t.value:t.type===c.SlimLoadingBarEventType.HEIGHT?e.height=t.value:t.type===c.SlimLoadingBarEventType.VISIBLE&&(e.show=t.value)})},i([o.Input(),n("design:type",String),n("design:paramtypes",[String])],e.prototype,"progress",null),i([o.Input(),n("design:type",String)],e.prototype,"color",void 0),i([o.Input(),n("design:type",String)],e.prototype,"height",void 0),i([o.Input(),n("design:type",Boolean)],e.prototype,"show",void 0),e=i([o.Component({selector:"ng2-slim-loading-bar",directives:[a.CORE_DIRECTIVES],template:'\n
\n
\n
'}),n("design:paramtypes",[c.SlimLoadingBarService])],e)}();return t.SlimLoadingBar=l,r.exports}),System.registerDynamic("src/service",["@angular/core","@angular/common/src/facade/lang","rxjs/Observable"],!0,function(e,t,r){"use strict";var i=this&&this.__decorate||function(e,t,r,i){var n,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},n=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=e("@angular/core"),s=e("@angular/common/src/facade/lang"),a=e("rxjs/Observable");!function(e){e[e.PROGRESS=0]="PROGRESS",e[e.HEIGHT=1]="HEIGHT",e[e.COLOR=2]="COLOR",e[e.VISIBLE=3]="VISIBLE"}(t.SlimLoadingBarEventType||(t.SlimLoadingBarEventType={}));var c=t.SlimLoadingBarEventType,l=function(){function e(e,t){this.type=e,this.value=t}return e}();t.SlimLoadingBarEvent=l;var p=function(){function e(){var e=this;this._progress=0,this._height="2px",this._color="firebrick",this._visible=!0,this._intervalCounterId=0,this.interval=500,this.observable=new a.Observable(function(t){e.subscriber=t})}return Object.defineProperty(e.prototype,"progress",{get:function(){return this._progress},set:function(e){s.isPresent(e)&&(e>0&&(this.visible=!0),this._progress=e,this.emitEvent(new l(c.PROGRESS,this._progress)))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(e){s.isPresent(e)&&(this._height=e,this.emitEvent(new l(c.HEIGHT,this._height)))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this._color},set:function(e){s.isPresent(e)&&(this._color=e,this.emitEvent(new l(c.COLOR,this._color)))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"visible",{get:function(){return this._visible},set:function(e){s.isPresent(e)&&(this._visible=e,this.emitEvent(new l(c.VISIBLE,this._visible)))},enumerable:!0,configurable:!0}),e.prototype.emitEvent=function(e){try{this.subscriber.next(e)}catch(e){console.log("!!! Suggestion: Seems you forget add into your html?")}},e.prototype.start=function(e){var t=this;void 0===e&&(e=null),this.stop(),this.visible=!0,this._intervalCounterId=setInterval(function(){t.progress++,100===t.progress&&t.complete()},this.interval)},e.prototype.stop=function(){this._intervalCounterId&&(clearInterval(this._intervalCounterId),this._intervalCounterId=null)},e.prototype.reset=function(){this.stop(),this.progress=0},e.prototype.complete=function(){var e=this;this.progress=100,this.stop(),setTimeout(function(){e.visible=!1,setTimeout(function(){e.progress=0},250)},250)},e=i([o.Injectable(),n("design:paramtypes",[])],e)}();return t.SlimLoadingBarService=p,r.exports}),System.registerDynamic("ng2-slim-loading-bar",["./src/component","./src/service"],!0,function(e,t,r){"use strict";function i(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}var n=e("./src/component"),o=e("./src/service");return i(e("./src/component")),i(e("./src/service")),Object.defineProperty(t,"__esModule",{value:!0}),t.default={providers:[o.SlimLoadingBarService],directives:[n.SlimLoadingBar]},r.exports}); //# sourceMappingURL=bundles/ng2-slim-loading-bar.min.js.map \ No newline at end of file diff --git a/karma.conf.js b/karma.conf.js index 4efc716..19dd48e 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -19,6 +19,7 @@ module.exports = function(config) { 'node_modules/zone.js/dist/zone.js', 'node_modules/zone.js/dist/long-stack-trace-zone.js', 'node_modules/zone.js/dist/jasmine-patch.js', + 'node_modules/zone.js/dist/async-test.js', 'node_modules/zone.js/dist/fake-async-test.js', 'node_modules/systemjs/dist/system.src.js', 'node_modules/reflect-metadata/Reflect.js', diff --git a/package.json b/package.json index 3d90f9c..cd19a90 100644 --- a/package.json +++ b/package.json @@ -29,11 +29,11 @@ "typings": "./ng2-slim-loading-bar.d.ts", "homepage": "https://github.com/akserg/ng2-slim-loading-bar", "dependencies": { - "@angular/common": "^2.0.0-rc.1", - "@angular/compiler": "^2.0.0-rc.1", - "@angular/core": "^2.0.0-rc.1", - "@angular/platform-browser": "^2.0.0-rc.1", - "@angular/platform-browser-dynamic": "^2.0.0-rc.1", + "@angular/common": "^2.0.0-rc.4", + "@angular/compiler": "^2.0.0-rc.4", + "@angular/core": "^2.0.0-rc.4", + "@angular/platform-browser": "^2.0.0-rc.4", + "@angular/platform-browser-dynamic": "^2.0.0-rc.4", "es6-promise": "~3.1.2", "es6-shim": "~0.35.0", "reflect-metadata": "0.1.2", diff --git a/tests/component.spec.ts b/tests/component.spec.ts index db6cb5e..c366574 100644 --- a/tests/component.spec.ts +++ b/tests/component.spec.ts @@ -7,7 +7,8 @@ import { //injectAsync, beforeEachProviders, fakeAsync, - tick + tick, + async } from '@angular/core/testing'; import { @@ -36,7 +37,7 @@ export function main() { }); // beforeEach(injectAsync([TestComponentBuilder], (tcb:TestComponentBuilder) => { - beforeEach(inject([TestComponentBuilder], (tcb:TestComponentBuilder) => { + beforeEach(async(inject([TestComponentBuilder], (tcb:TestComponentBuilder) => { return tcb.createAsync(SlimLoadingBar).then((cf:ComponentFixture) => { componentFixture = cf; let element = componentFixture.elementRef.nativeElement; @@ -45,7 +46,7 @@ export function main() { component = componentFixture.componentInstance; componentFixture.detectChanges(); }); - })); + }))); it('should be defined', () => { expect(containerDiv).toBeDefined();