Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app/ components need to use the new cp syntax #66

Open
jayphelps opened this issue Jun 4, 2015 · 0 comments
Open

app/ components need to use the new cp syntax #66

jayphelps opened this issue Jun 4, 2015 · 0 comments
Assignees
Milestone

Comments

@jayphelps
Copy link
Member

Apparently when I did #63, I missed the entire app/ directory......

New syntax with polyfill looks like this:

import computed from 'ember-new-computed';

export default Ember.Component.extend({
  fullName: computed('firstName', 'lastName', {
    get() {
      return this.get('firstName') + ' ' + this.get('lastName');
    },
    set(key, newName) {
      var parts = newName.split(' ');
      this.setProperties({ firstName: parts[0], lastName: parts[1] });
      return newName;
    }
  });
});

Getter-only should still use this syntax, just not include a set()

@jayphelps jayphelps self-assigned this Jun 4, 2015
@jayphelps jayphelps added this to the 1.0.0 milestone Jun 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant