From 78ae76cd6d22de88b5689956047f7578bf552e5e Mon Sep 17 00:00:00 2001 From: Pete Date: Fri, 22 Jan 2021 16:01:19 -0800 Subject: [PATCH] Update ngu-carousel.ts Fixes #322 Declared types [are not minified](https://developers.google.com/closure/compiler/docs/api-tutorial3#extocomp) and therefore adding `declare`-ed interfaces prevents undesirable conflicts between dot- and string-references to properties. --- .../src/lib/ngu-carousel/ngu-carousel.ts | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/projects/ngu-carousel/src/lib/ngu-carousel/ngu-carousel.ts b/projects/ngu-carousel/src/lib/ngu-carousel/ngu-carousel.ts index df39fc1b..9e5bd690 100644 --- a/projects/ngu-carousel/src/lib/ngu-carousel/ngu-carousel.ts +++ b/projects/ngu-carousel/src/lib/ngu-carousel/ngu-carousel.ts @@ -57,11 +57,30 @@ export class Touch { velocity: number; } -export class Transfrom { +// Interface is declared to prevent property-minification +// See: https://github.com/uiuniversal/ngu-carousel/issues/322 +declare interface TransformInterface { + xs: number; + sm: number; + md: number; + lg: number; + xl?: number; + all: number; +} + +export class Transfrom implements TransformInterface { public xl? = 0; constructor(public xs = 0, public sm = 0, public md = 0, public lg = 0, public all = 0) {} } +// Interface is declared to prevent property-minification +// See: https://github.com/uiuniversal/ngu-carousel/issues/322 +declare interface BreakpointsInterface { + sm: number; + md: number; + lg: number; + xl: number; +} /** * Default values @@ -70,7 +89,7 @@ export class Transfrom { * Bootstrap values: * {sm: 576, md: 768, lg: 992, xl: 1200} */ -export class Breakpoints { +export class Breakpoints implements BreakpointsInterface { constructor(public sm = 768, public md = 992, public lg = 1200, public xl = 1200) {} }