Skip to content

kturney/ember-lookup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3315170 · Dec 12, 2017

History

26 Commits
Oct 11, 2017
Feb 13, 2017
Dec 12, 2017
Oct 11, 2017
Feb 13, 2017
Feb 13, 2017
Feb 13, 2017
May 3, 2017
Jul 15, 2017
Dec 12, 2017
Dec 12, 2017
Feb 13, 2017
Feb 13, 2017
Feb 14, 2017
Jul 15, 2017
May 3, 2017
Feb 13, 2017
Dec 12, 2017
Dec 12, 2017
Dec 12, 2017

Repository files navigation

ember-lookup

Latest NPM release TravisCI Build Status Ember Observer Score

This provides a helper that allows using Ember.getOwner()#lookup from templates.

Installation

ember install ember-lookup

Usage

Lookup a service

By default, ember-lookup will lookup a service.

{{#with (lookup 'my-service') as |myService|}}
  {{! use service }}
{{/with}}

Lookup anything registered with ember

The type of the object to lookup may be provided as the second parameter.

{{#with (lookup 'environment' 'config') as |config|}}
  {{! use config }}
{{/with}}
{{#with (lookup 'foo' 'bar') as |foo|}}
  {{! use foo of type bar }}
{{/with}}

If using ember-let

{{let myService=(lookup 'my-service')}}

Credit where credit is due

Basically copied from this issue by rwjblue in ember-with-service.

Running Tests

  • npm test (Runs ember try:each to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit https://ember-cli.com/.