0

I inherited an ember application and can't figure out how to add a component to an engine.

I tried to create the component with:

web-app$ ember g component about-profile -ir fs-engine
installing component
  create lib/fs-engine/addon/components/about-profile.js
  create lib/fs-engine/addon/templates/components/about-profile.hbs
installing component-test
  create tests/integration/components/about-profile-test.js
installing component-addon
  create lib/fs-engine/app/components/about-profile.js

I then added the following to lib/fs-engine/addon/templates/components/about-profile.hbs

<article>
  <h1>Test</h1>
  <p>Please work</p>
</article>

I try to invoke this component at the template file lib/fs-engine/addon/templates/gw/itemdetail.hbs

<div>{{about-profile}}</div>

It returns empty. Nothing is rendered. No error messages are displayed anywhere.

I am sure I am missing something very basic since I am new to Ember but I did read Ember Engines guide (http://ember-engines.com/guide) and Ember Component guide (https://guides.emberjs.com/v2.12.0/components/defining-a-component/).

thanks for your help!

Rick
  • 21
  • 1
  • Please check `itemdetail.hbs` parent hbs contains `{{outlet}}` ? – Ember Freak Nov 10 '17 at 05:26
  • I tried adding {{outlet}} to the parent hbs and it did not solve the issue. Note that there are currently other components inside this engine that works so the issue is related to my newly created component only. – Rick Nov 10 '17 at 20:54

1 Answers1

0

as it turns out, I was able to resolve this issue by stopping "ember server" and then restarting it after creating the component. simple as that!

Rick
  • 21
  • 1