/ember-service-helper

Simple template helper to inject services into templates

Primary LanguageJavaScriptMIT LicenseMIT

This fork has been frozen

The original add-on https://github.com/buschtoens/ember-service-helper has recently (27 July 2021) been updated:

https://github.com/buschtoens/ember-service-helper/releases/tag/v0.2.0

Please consider using it instead of this fork that I am going to stop maintaining (until the original add-on stops being maintained again).

ember-service-helper

CodeQL

Simple template helper to inject services into templates.

Credits go to @buschtoens for its initial implementation:
https://github.com/buschtoens/ember-service-helper

Installation

ember install MrChocolatine/ember-service-helper

Usage

Get a Service object

Example using ember-responsive.

{{#with (service "some-service") as |serviceX|}}
  <div>
    {{serviceX.propA}}
  </div>
  <div>
    {{serviceX.propB}}
  </div>
{{/with}}

Get directly a property from a Service

<div>
  {{service "some-service" "propA"}}
</div>

Related