You can add an event listener using plain JS, where you can check that the width of the window matches your mobile breakpoint. Just make sure you wrap the actual change to the scope variable in a $apply
function otherwise AngularJS will not know about it:
https://plnkr.co/edit/ZzbXZ3lFxqX6Tlra46W5?p=preview
angular.module('ui.bootstrap.demo').controller('CollapseDemoCtrl', function ($scope) {
$scope.isNavCollapsed = true;
$scope.isCollapsed = false;
$scope.isCollapsedHorizontal = false;
document.addEventListener('click', collapseMenu, false);
function collapseMenu(event) {
if(event.target.matches('.nav.navbar-nav li a') && window.innerWidth < 768) {
$scope.$apply(function() {
$scope.isNavCollapsed = true;
});
}
}
// prevent memory leaks by removing listener when scope is destroyed
$scope.$on("$destroy", function() {
document.removeEventListener('click', collapseMenu, false);
});
});
Note that this will require you to keep your CSS and JS in sync with regards to the breakpoint value