facultymatt/angular-unsavedChanges — pull request #15 by tborres (2014-07-30 21:14:47+00:00)
Title: Features/disable reload warning

Not sure if this is an especially useful feature or not, but I figured I might as well pull request it.

Issue:
The confirmExit was causing my karma e2e tests (in a separate app) to fail with the error "Some of your tests did a full page reload!". This error does not occur when the reload confirmation window is not present.

Solution:
Added a disableReloadConfirm configuration variable, which defaults to false (thereby defaulting to the existing behavior of confirming with the user that he or she would like to change pages). If this config variable is set to true then the confirmation will not occur. This can be toggled to true when running e2e tests, or any other time that page reload should be allowed but navigation within the application should not.

Testing Notes:
Tests were not created for this because there were failing tests (e2e and unit) on the latest branch. However, it's possible that I may be running the tests incorrectly.

Feedback and suggestions are encouraged and welcome!