ember-cli-htmlbars-inline-precompile
Precompile inline HTMLBars templates via ES6 tagged template strings
Last updated 4 months ago by rwjblue .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ember-cli-htmlbars-inline-precompile 
SYNC missed versions from official npm registry.

ember-cli-htmlbars-inline-precompile

npm version Build Status Ember Observer Score Dependency Status

Deprecated

Usage of this project is deprecated, its functionality has been migrated into ember-cli-htmlbars directly. Please upgrade to ember-cli-htmlbars@4.0.3 or higher.

Usage

Precompile template strings within the tests of an Ember project via tagged template strings:

// ember-cli-project/test/unit/components/my-component-test.js
import { module, test } from 'qunit';
import { render } from '@ember/test-helpers';
import { setupRenderingTest } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';

module('my-component', function(hooks) {
  setupRenderingTest(hooks);

  test('it renders', async function(assert) {
    await render(hbs`hello ember testing!`);

    assert.equal(this.element.innerText, 'hello ember testing!');
  });
});

Requirements

  • Ember 2.12+
  • Node 8+
  • Babel 7+

Installation

Install the addon via ember install ember-cli-htmlbars-inline-precompile

Caveats

Keep in mind that the source files are transformed, so the inline template definitions are replaced with Ember.HTMLBars.template(…) statements. This means that you can't do fancy stuff like string interpolation within the templates:

test('string interpolation within templates is NOT supported', async function(assert) {
  let valuePath = 'greeting';

  await render(hbs`
    ${valuePath}: <span>{{value}}</span>
  `);

  // the template will be "${valuePath}: <span>{{value}}</span>"
});

If you need stuff like this, you need to include ember-template-compiler.js in your test-build and use Ember.HTMLBars.compile("…") within your tests.

Current Tags

  • 0.4.0-beta.2                                ...           beta (3 years ago)
  • 3.0.1                                ...           latest (4 months ago)
  • 0.3.12                                ...           v0-3-x (2 years ago)

37 Versions

  • 3.0.1                                ...           4 months ago
  • 3.0.0                                ...           5 months ago
  • 2.1.0                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 1.0.5                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 0.3.13                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.4.4                                ...           2 years ago
  • 0.3.12                                ...           2 years ago
  • 0.4.3                                ...           3 years ago
  • 0.3.11                                ...           3 years ago
  • 0.3.10                                ...           3 years ago
  • 0.3.9                                ...           3 years ago
  • 0.4.2                                ...           3 years ago
  • 0.4.1                                ...           3 years ago
  • 0.3.8                                ...           3 years ago
  • 0.3.7                                ...           3 years ago
  • 0.4.0                                ...           3 years ago
  • 0.4.0-beta.2                                ...           3 years ago
  • 0.4.0-beta.1                                ...           3 years ago
  • 0.3.6                                ...           3 years ago
  • 0.3.5                                ...           3 years ago
  • 0.3.4                                ...           3 years ago
  • 0.3.3                                ...           3 years ago
  • 0.3.2                                ...           4 years ago
  • 0.3.1                                ...           4 years ago
  • 0.3.0                                ...           4 years ago
  • 0.2.0                                ...           5 years ago
  • 0.1.3                                ...           5 years ago
  • 0.1.2                                ...           5 years ago
  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
  • 0.0.1                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 256
Last Day 2
Last Week 57
Last Month 467
Dependents (356)

Copyright 2014 - 2017 © taobao.org |