Skip to content

Instantly share code, notes, and snippets.

@deedubs
Created October 26, 2012 13:59
Show Gist options
  • Save deedubs/3958971 to your computer and use it in GitHub Desktop.
Save deedubs/3958971 to your computer and use it in GitHub Desktop.
$scope.getWidth = function() {
return $(window).width();
};
$scope.$watch($scope.getWidth, function(newValue, oldValue) {
$scope.window_width = newValue;
});
window.onresize = function(){
$scope.$apply(function() {
if($scope.window_width < 768) {
$rootScope.showMap = false;
} else {
$rootScope.showMap = true;
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment