jacopotarantino / angular-match-media

Angular module to use Bootstrap3 media queries in your angular controllers.
https://jack.ofspades.com/angular-matchmedia-module/
Other
135 stars 37 forks source link

Can't extend default rules #40

Closed arajay closed 6 years ago

arajay commented 7 years ago

The var defaultRules can't be extended. When I create my own rules, I have to redeclare all the default rules too. This could cause problems if the default breakpoints change in a later version.

Example screenSize.rules = { lg: '(min-width: 1200px)', // default rule md: '(min-width: 992px) and (max-width: 1199px)', // default rule mobileLandscape: '(max-width: 768px) and (orientation: landscape)', // my custom rule sm: '(min-width: 768px) and (max-width: 991px)', // default rule xs: '(max-width: 767px)' // default rule }

jacopotarantino commented 7 years ago

That seems quite true. Could you make a PR to fix it? Or better, a PR with a cleaned-up ng2 friendly API? It's a big ask but I don't have time to do the whole thing myself right now.

zacronos commented 6 years ago

This has been fixed on master. (Next time a new npm version is published, this will be included.)

See the README for details on how to extend the default rules.