If a user changes the dynamic segment (object identifier) in the URL of an Ember application with Ember Data, what is the best practice for handling these URLs because they can refer to non-existing Model entries?
In the minimal example, you will notice that for each call with a non-existent identifier (for example, http://emberjs.jsbin.com/hurozaju/9#/color/30 ) an empty object is added to the local ember data store. This is easy to observe due to the increase in the number of "points" at the output.
App.ColorRoute application error redirects (as intended) to "colors" in the event 404 occurs when the model is retrieved by identifier.
Why is there a “new” item in the store?
Should you leave the data unchanged?
Is there a chance to prevent the creation of new objects in this case?
source
share