ember-computed-template-string

v0.1.4
One-line string computed properties
ember-addon

ember-computed-template-string

Build Status Ember Observer Score

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 repository
  • npm install
  • bower install

Running

npm i ember-computed-template-string

Metadata

  • Apache-2.0
  • >= 5.0.0
  • Intercom Engineering
  • released 8/12/2016

Downloads

Maintainers