Closed demiro closed 8 years ago
Hey, thanks! Sorry it's poorly documented but there is actually an on
method that you could use: https://github.com/jacopotarantino/angular-match-media/blob/master/match-media.js#L115
That should trigger on window resize which sounds like what you want. If you want to document it or add another method that does something different, I wouldn't mind a pull request.
Let me know if you have any other questions or if that wasn't what you wanted.
Sadly it doesn't .... this triggers each time a window is resized...
imagine that you are SM... and resizing window from 768 to 992 .... each time you'd resize it'll still trigger... even though the mq layout hasn't changed...
right now I am having a helper variable: before ... and on each resize checks if the new value is different than "before".. then, and only then I trigger a callback...
Hmm... you're right. It might be a good idea to refactor a bit as the namespacing is getting a bit cluttered. I'd appreciate a PR with the changes you'd like to see if you have time.
I've added the .when method a few months ago which - if I understand correctly - is what @demiro wants?
Probably way too late, but check my pull request: https://github.com/jacopotarantino/angular-match-media/pull/22
Closing this as I believe it has been resolved.
Hello,
nice and clean utility. Very handy!
The only thing it misses is a onChange event that would trigger when you actually change t-shirt view port and not on every resize...
so like screenSize.onChange(new, function(....)
but would also help to have an old value, so from->to