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

Uncaught TypeError: callback is not a function match-media.js:155 #46

Open Mr-Anonymous opened 6 years ago

Mr-Anonymous commented 6 years ago

I installed this plugin in Angular 1.3 and I am using the .on method like this:

Main Controller:

vm.desktop = screenSize.on('md, lg');
vm.mobile = screenSize.on('xs, sm');

Ng-View:

<div ng-if="main.desktop">
  Show Desktop
</div>

<div ng-if="main.mobile">
  Show Mobile
</div>

![Uploading media-query-plugin.png…]()

When the browser is resized, I keep getting this error in Google Chrome Console:

match-media.js:155 
Uncaught TypeError: callback is not a function
    at listenerFunc (match-media.js:155)