From 1fa7e9802b1af78b61ca316fd4e94585a5d31256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabien=20Dehopr=C3=A9?= Date: Thu, 22 Dec 2016 12:22:23 +0100 Subject: [PATCH 1/3] only import rxjs/Subscription instead of the whole rxjs library --- src/calendar.pipe.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calendar.pipe.ts b/src/calendar.pipe.ts index 4f71e3c..7ecfbd6 100644 --- a/src/calendar.pipe.ts +++ b/src/calendar.pipe.ts @@ -2,7 +2,7 @@ import {Pipe, ChangeDetectorRef, PipeTransform, EventEmitter, OnDestroy, NgZone} from '@angular/core'; import * as moment from 'moment'; -import {Subscription} from 'rxjs'; +import {Subscription} from 'rxjs/Subscription'; // under systemjs, moment is actually exported as the default export, so we account for that const momentConstructor: (value?: any) => moment.Moment = (moment).default || moment; From 517f5f6ea7c6dd1fed4596c2f643a6066b8535b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabien=20Dehopr=C3=A9?= Date: Thu, 22 Dec 2016 12:23:50 +0100 Subject: [PATCH 2/3] move moment dependency to dev and peer dependencies --- package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 544f630..ded456f 100644 --- a/package.json +++ b/package.json @@ -66,9 +66,7 @@ }, "homepage": "https://github.com/urish/angular2-moment#readme", "peerDependencies": { - "@angular/core": "^2.0.0-rc.5" - }, - "dependencies": { + "@angular/core": "^2.0.0-rc.5", "moment": "^2.16.0" }, "devDependencies": { @@ -88,6 +86,7 @@ "karma-phantomjs-launcher": "1.0.1", "karma-sourcemap-loader": "0.3.7", "karma-webpack": "1.7.0", + "moment": "^2.16.0", "phantomjs-prebuilt": "2.1.7", "reflect-metadata": "0.1.3", "rxjs": "5.0.0-beta.12", From 790aa3a923b659df8e61da398d088014da0c0956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabien=20Dehopr=C3=A9?= Date: Thu, 22 Dec 2016 12:28:01 +0100 Subject: [PATCH 3/3] fix typing issues in both add and subtract pipes these issues were raised by the linter --- src/add.pipe.ts | 2 +- src/subtract.pipe.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/add.pipe.ts b/src/add.pipe.ts index 00e4d56..53c2715 100644 --- a/src/add.pipe.ts +++ b/src/add.pipe.ts @@ -5,7 +5,7 @@ import * as moment from 'moment'; @Pipe({ name: 'amAdd' }) export class AddPipe implements PipeTransform { - transform(value: any, ...args: string[]): any { + transform(value: any, ...args: any[]): any { if (typeof args === 'undefined' || args.length !== 2) { throw new Error('AddPipe: missing required arguments'); } diff --git a/src/subtract.pipe.ts b/src/subtract.pipe.ts index b1ac60b..b139f75 100644 --- a/src/subtract.pipe.ts +++ b/src/subtract.pipe.ts @@ -5,7 +5,7 @@ import * as moment from 'moment'; @Pipe({ name: 'amSubtract' }) export class SubtractPipe implements PipeTransform { - transform(value: any, ...args: string[]): any { + transform(value: any, ...args: any[]): any { if (typeof args === 'undefined' || args.length !== 2) { throw new Error('SubtractPipe: missing required arguments'); }