From 3fa1f9ae1b8a13860c880d8f7226ea777180ef2f Mon Sep 17 00:00:00 2001 From: Sergey Akopkokhyants Date: Thu, 26 May 2016 13:59:42 +0200 Subject: [PATCH] fix($browser): Fixed issue Bundle not working with angular-rc.1 --- bundles/ng2-slim-loading-bar.js | 22 ++++++++++++---------- bundles/ng2-slim-loading-bar.min.js | 2 +- make.js | 8 ++++---- package.json | 10 ++++++---- tsconfig.json | 9 +++------ 5 files changed, 26 insertions(+), 25 deletions(-) diff --git a/bundles/ng2-slim-loading-bar.js b/bundles/ng2-slim-loading-bar.js index 256d1f3..1611f44 100644 --- a/bundles/ng2-slim-loading-bar.js +++ b/bundles/ng2-slim-loading-bar.js @@ -1,4 +1,5 @@ -System.registerDynamic("src/component", ["angular2/core", "angular2/src/facade/lang", "angular2/common", "./service"], true, function($__require, exports, module) { +System.registerDynamic("src/component", ["@angular/core", "@angular/common/src/facade/lang", "@angular/common", "./service"], true, function($__require, exports, module) { + "use strict"; ; var define, global = this, @@ -19,9 +20,9 @@ System.registerDynamic("src/component", ["angular2/core", "angular2/src/facade/l if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; - var core_1 = $__require('angular2/core'); - var lang_1 = $__require('angular2/src/facade/lang'); - var common_1 = $__require('angular2/common'); + var core_1 = $__require('@angular/core'); + var lang_1 = $__require('@angular/common/src/facade/lang'); + var common_1 = $__require('@angular/common'); var service_1 = $__require('./service'); var SlimLoadingBar = (function() { function SlimLoadingBar(service) { @@ -67,12 +68,13 @@ System.registerDynamic("src/component", ["angular2/core", "angular2/src/facade/l template: "\n
\n
\n
" }), __metadata('design:paramtypes', [service_1.SlimLoadingBarService])], SlimLoadingBar); return SlimLoadingBar; - })(); + }()); exports.SlimLoadingBar = SlimLoadingBar; return module.exports; }); -System.registerDynamic("src/service", ["angular2/core", "angular2/src/facade/lang", "rxjs/Observable"], true, function($__require, exports, module) { +System.registerDynamic("src/service", ["@angular/core", "@angular/common/src/facade/lang", "rxjs/Observable"], true, function($__require, exports, module) { + "use strict"; ; var define, global = this, @@ -93,8 +95,8 @@ System.registerDynamic("src/service", ["angular2/core", "angular2/src/facade/lan if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; - var core_1 = $__require('angular2/core'); - var lang_1 = $__require('angular2/src/facade/lang'); + var core_1 = $__require('@angular/core'); + var lang_1 = $__require('@angular/common/src/facade/lang'); var Observable_1 = $__require('rxjs/Observable'); (function(SlimLoadingBarEventType) { SlimLoadingBarEventType[SlimLoadingBarEventType["PROGRESS"] = 0] = "PROGRESS"; @@ -109,7 +111,7 @@ System.registerDynamic("src/service", ["angular2/core", "angular2/src/facade/lan this.value = value; } return SlimLoadingBarEvent; - })(); + }()); exports.SlimLoadingBarEvent = SlimLoadingBarEvent; var SlimLoadingBarService = (function() { function SlimLoadingBarService() { @@ -223,7 +225,7 @@ System.registerDynamic("src/service", ["angular2/core", "angular2/src/facade/lan }; SlimLoadingBarService = __decorate([core_1.Injectable(), __metadata('design:paramtypes', [])], SlimLoadingBarService); return SlimLoadingBarService; - })(); + }()); exports.SlimLoadingBarService = SlimLoadingBarService; return module.exports; }); diff --git a/bundles/ng2-slim-loading-bar.min.js b/bundles/ng2-slim-loading-bar.min.js index 710d457..84ef389 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",["angular2/core","angular2/src/facade/lang","angular2/common","./service"],!0,function(e,t,r){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("angular2/core"),s=e("angular2/src/facade/lang"),a=e("angular2/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",["angular2/core","angular2/src/facade/lang","rxjs/Observable"],!0,function(e,t,r){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("angular2/core"),s=e("angular2/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=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}); //# sourceMappingURL=bundles/ng2-slim-loading-bar.min.js.map \ No newline at end of file diff --git a/make.js b/make.js index afafc03..86c777d 100644 --- a/make.js +++ b/make.js @@ -11,15 +11,15 @@ var config = { module: 'cjs' }, map: { - typescript: './node_modules/typescript/lib/typescript.js', - angular2: path.resolve('node_modules/angular2'), - rxjs: path.resolve('node_modules/rxjs') + 'typescript': './node_modules/typescript/lib/typescript.js', + '@angular': path.resolve('node_modules/@angular'), + 'rxjs': path.resolve('node_modules/rxjs') }, paths: { '*': '*.js' }, meta: { - 'node_modules/angular2/*': { build: false }, + 'node_modules/@angular/*': { build: false }, 'node_modules/rxjs/*': { build: false } }, }; diff --git a/package.json b/package.json index d3bdac1..3d90f9c 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "main": "ng2-slim-loading-bar.js", "typings": "./ng2-slim-loading-bar.d.ts", "homepage": "https://github.com/akserg/ng2-slim-loading-bar", - "devDependencies": { + "dependencies": { "@angular/common": "^2.0.0-rc.1", "@angular/compiler": "^2.0.0-rc.1", "@angular/core": "^2.0.0-rc.1", @@ -38,7 +38,9 @@ "es6-shim": "~0.35.0", "reflect-metadata": "0.1.2", "rxjs": "5.0.0-beta.6", - "zone.js": "~0.6.12", + "zone.js": "~0.6.12" + }, + "devDependencies": { "jasmine-core": "~2.3.4", "karma": "~0.13.15", "karma-chrome-launcher": "~0.2.2", @@ -49,8 +51,8 @@ "systemjs": "~0.19.6", "systemjs-builder": "^0.15.6", "tsd": "^0.6.5", - "typescript": "~1.7.3", - "typings": "^0.6.8", + "typescript": "^1.8.7", + "typings": "^0.8.1", "uglify-js": "^2.6.2", "commitizen": "^2.7.6", "cz-conventional-changelog": "^1.1.5" diff --git a/tsconfig.json b/tsconfig.json index 20d8d28..6b85cbf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,12 +9,9 @@ "moduleResolution": "node", "sourceMap": true }, - "files": [ + "exclude": [ + "node_modules", "typings/main.d.ts", - "ng2-slim-loading-bar.ts", - "./src/component.ts", - "./src/service.ts", - "./tests/component.spec.ts", - "./tests/service.spec.ts" + "typings/main" ] } \ No newline at end of file