Skip to content

Instantly share code, notes, and snippets.

@g-cassie
Last active February 25, 2016 14:43
Show Gist options
  • Save g-cassie/3abc9219839257ff6b00 to your computer and use it in GitHub Desktop.
Save g-cassie/3abc9219839257ff6b00 to your computer and use it in GitHub Desktop.
// my-addon/templates/components/addon-componenent.hbs
We are going to render a component here:
{{component selectedComponent}}
// my-app/components/app-component.js
Ember.Component.extend({
// using ember inspect myService === undefined when using the application template below
myService: Ember.inject.service()
});
// my-app/templates/components/app-component.hbs
This should have a value: {{myService.myValue}}
// my-addon/components/nested-addon-component.js
Ember.Component.extend({
// this works fine
myService: Ember.inject.service()
});
// my-addon/templates/components/nested-addon-component.hbs
This should have a value: {{myService.myValue}}
// my-app/application.hbs
{{addon-component selectedComponent='app-component'}}
{{addon-component selectedComponent='nested-addon-component'}}
/// output
This should have a value:
This should have a value: "some value"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment