#75 Are You Sure

Tip Stolen* from EmberScreencasts Episode 170:Here is a very simple way to prompt the user if they want to navigate away before saving their data.  The last thing you want is for them to fill out a long form then accidentally navigate away.

In your route, you would add something like this:

You will have to implement the isDirty property in your controller to indicate the state of your model.  In the screencast, Jeffrey uses ember-changeset to accomplish that.  See the related tips 61 and 62.

*stolen with permission for Jeffrey – thank you.


Also published on Medium.

Published by

Emad Ibrahim

Author of asp .net MVC & TDD, entrepreneur, passionate technologist, programmer and productivity nut. more at http://t.co/oSJXPvzu