ember-computed-template-string

0.1.4 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i ember-computed-template-string

Weekly Downloads

1

Version

0.1.4

License

Apache-2.0

Last publish

Collaborators

  • gavinjoyce