Fix for issue #2812

https://github.com/angular-ui/bootstrap/issues/2812