Hey,
that shouldn't be too hard I guess:
Attach a namespace object to the window object: var myNamepace = {}; //outside of angular's scope
Then i'd create a service responsible for handling the enquire.js logic so it could be shared among different controllers/directives...
myApp.factory('EnquireService', ['$window', function($window) {
screenWidth1000Match = function() { /* doSomething */ }; //or some other name, you get the point
//attach to previously created object
$window.myNamespace.screenWidth1000Match = screenWidth1000Match;
}])
//outside of angular's scope again register the function with enquire:
enquire.register("screen and (max-width:1000px)", {
match : myNamespace.screenWidth1000Match
});
- Flo