ember-lookup
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}}
ember-let
If using{{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
(Runsember 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/.