Skip to content

isabella232/ember-computed-template-string

 
 

Repository files navigation

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

About

⚡ One-line string computed properties

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 86.4%
  • HTML 13.6%