lgsilver/angles — pull request #40 by NateRedding (2014-07-10 15:58:30+00:00)
Title: Angular Routing Fix

The following code was recently merged into the master branch.

```javascript
//unbind the event when scope destroyed
$scope.$on("$destroy", function() {
angular.element(window).off();
});
```

Calling ```off()``` without any event types on the window element will de-register ALL event listeners on the ```window``` object. This has the side-effect of removing the listeners that ngRoute uses to listen for page change events (ie. those as generated by the browser Back/Forward buttons). This breaks the usage of back/forward buttons in Angular.

This changes this deregistration to the below so that only 'resize' listeners are removed.

```javascript
//unbind the event when scope destroyed
$scope.$on("$destroy", function() {
angular.element(window).off('resize');
});
```

This pull request also includes a commit that makes some style consistency changes. Previously, there was inconsistent whitespace and a couple missing semicolons. If you would prefer to keep the styling as-is, I can remove that commit.