This mixin handles some behavior on controllers or routes that are editing models. If the model is dirty (e.g. has been changed since the route was entered), this mixin adds functionality that warns users about potentially losing data. If the user then chooses to leave this mixin handles reverting the changes back to their previous state.

Designed for use in routes, but can be applied on controllers

Show:
_rollback () private

Handles rollback behavior

_rollbackMessage () private

Callback for the onbeforeunload window event.

activate () private

Activates rollback functionality

isDirty () protected

Helper function to determine if a model or other related resource is dirty

willTransition

protected

Event to hook into Ember route's willTransition action. Handles rollback behavior on route transition