Slug urls with Ember.js

梦想与她 提交于 2019-12-01 21:22:46

You're mismatching versions of Ember Data. In the PageRoute you are using the model definition to try and find the record which is no longer correct. See https://github.com/emberjs/data/blob/master/TRANSITION.md

Additionally you really should just replace id with the slug since you've essentially rendered the idea of unique items worthless (aka slug doesn't have to be unique, but id does, so what happens when you have multiple items with the same slug?) If your slugs will always be unique, you might as well use them as the id there is no constraint that id must be numeric.

http://emberjs.jsbin.com/AVAgUZAb/9/edit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!