namespaces - Reserved atribute names in Ember.js models -
i have post model following fields:
blogapp.post = ds.model.extend({ author: ds.attr('string'), title: ds.attr('string'), preamble: ds.attr('string'), content: ds.attr('string'), created: ds.attr('date'), comments: ds.hasmany('blogapp.comment'), lastupdate: ds.attr('date') });
after rendering, instead of post.content, result like:
<blogapp.post:ember272:1>
other fields rendering ok. guess content
conflicting internal property. have few questions:
- is there workarround when rest api has names conflict ember internals?
- is there other forbiden attribute names should aware?
[update]
the name clash controller, not model. not definitive list watch out other common database column names like:
- model
- transaction
- is_new
- is_deleted
- store
- errors
i guess ember developers not afraid of namespace-related bugs poor pythonist.
btw, angular.js guys got right: prefix api attributes , methods $
preventing kind of bug.
i'm trying answer 2 questions:
1 can define mapping of keys, here example content
property
app.adapter.map('app.post', { mycontent: {key: 'content'} });
2 far know there no such explicit
list of reserved names in ember, rule of thumb generic names content
should avoided (preventively)
hope helps
Comments
Post a Comment