ng-unsaved-changes
An angular directive to notify the user before leaving a page with unsaved changes in forms.
usage
npm i ng-unsaved-changes# or bower install ng-unsaved-changes
angular ; SetupUnsavedChanges$inject = 'UnsavedChangedService'; { $unsavedChanges; $unsavedChanges; { // show your user whatever you want to warn him about leaving a page // with unsaved changes. Look at the demo to see an example of how to display // a modal with a warning // if your user confirms that he want to leave, call confirm -> ; }}
<!-- ... ---></form>
Currently only works for forms!
license
MIT