scaleflex / ng-cloudimage-responsive

Cloudimage responsive plugin will make your website load the exact image size you need depending on your user's screen size. Multiple pixel ratios are supported. Any questions or issues, please report to https://github.com/scaleflex/ng-cloudimage-responsive/issues
MIT License
16 stars 6 forks source link

Angular SSR matchMedia is not definet #25

Open jemys89 opened 3 years ago

jemys89 commented 3 years ago

Hi,

I am using universal angular. I can't fix the implementation of multiple screens.

my configuration in app.module:

const ciConfig = {
  token: '****',
  baseUrl: '**********',
  presets: {
    xs: '(max-width: 575px)', // up to 575    PHONE
    sm: '(min-width: 576px)', // 576 - 767    PHABLET
    md: '(min-width: 768px)', // 768 - 991    TABLET
    lg: '(min-width: 992px)', // 992 - 1199   SMALL_LAPTOP_SCREEN
    xl: '(min-width: 1200px)' // from 1200    USUALSCREEN
  }
};

<ci-img [src]="image.src" operation="crop" size='xs 500x600, md 1000x1350, lg 1400x1200, xl 1600x1000'></ci-img>

ERROR ReferenceError: matchMedia is not defined
    at /*/dist/web/server/main.js:171717:39
    at Array.find (<anonymous>)
    at CIService.getBreakPoint