abuiles / ember-101

https://leanpub.com/ember-cli-101
95 stars 23 forks source link

Regarding resetController #51

Open ptmoy2 opened 8 years ago

ptmoy2 commented 8 years ago

On page 78, the author discusses calling model.destroyRecord() & model.rollback() in the resetController hook in app/routes/friends/new.js and app/routes/friends/edit.js to get rid of unsaved new records and unsaved edits in the store respectively. Instead of calling these functions in the resetController hook, can these be called from the cancel() action in app/controller/friends/new.js & app/controller/friends/edit.js instead? If not, why?