Skip to content

Commit

Permalink
Merge pull request #4337 from villander/master
Browse files Browse the repository at this point in the history
[DOC] Update README.md for improve ES6 syntax in example
  • Loading branch information
pangratz committed Apr 16, 2016
2 parents f9addb8 + cbf2ff7 commit a9f57a4
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ground up to manage loading and saving records, so integrating with
other JavaScript APIs is easy.

Igor Terzic is currently the lead maintainer of Ember Data, while the rest
of the core team include Yehuda Katz, Tom Dale, Brendan McLoughlin,
of the core team include Yehuda Katz, Tom Dale, Brendan McLoughlin,
Christoffer Persson and Stanley Stuart.

## Using Ember Data
Expand Down Expand Up @@ -81,21 +81,25 @@ ES6 modules (via ember-cli):
// app/models/blog-post.js
import DS from 'ember-data';

const { attr, hasMany } = DS;

export default DS.Model.extend({
title: DS.attr('string'),
createdAt: DS.attr('date'),
title: attr('string'),
createdAt: attr('date'),

comments: DS.hasMany('comment')
comments: hasMany('comment')
});

// app/models/comment.js
import DS from 'ember-data';

const { attr, belongsTo } = DS;

export default DS.Model.extend({
body: DS.attr('string'),
username: DS.attr('string'),
body: attr('string'),
username: attr('string'),

post: DS.belongsTo('blog-post')
post: belongsTo('blog-post')
});
```

Expand Down

0 comments on commit a9f57a4

Please sign in to comment.