ember-computed-template-string
v0.1.4
Published
One-line string computed properties
Downloads
2
Readme
ember-computed-template-string
Consider the canonical computed property example:
Ember.Object.extend({
firstName: 'Serena',
lastName: 'Fritsch',
fullName: Ember.computed('firstName', 'lastName', function() {
return `${this.get('firstName')} ${this.get('lastName')}`;
})
});
ember-computed-template-string
provides a macro which removes the duplication:
import templateString from 'ember-computed-template-string';
Ember.Object.extend({
firstName: 'Serena',
lastName: 'Fritsch',
fullName: templateString("${firstName} ${lastName}")
});
Installation
This is an Ember CLI addon, to install:
ember install ember-computed-template-string
Development Instructions
git clone
this repositorynpm install
bower install
Running
ember server
- Visit your app at http://localhost:4200.