Search code examples
ember.jsember-cli

Ember CLI can't find partial


I am working on an addon. I try to use partial. In my addon/templates/components/form.hbs I got {{partial "pane"}}. My _pane.hbs is in addon/templates folder but ember can't find it:

Uncaught Error: Assertion Failed: Unable to find partial with name "pane".

I also tried to put _pane.hbs in addon/templates/components but no luck. Where should I put it to get picked up by ember?


Solution

  • As mentioned here, everything is dasherized in Ember CLI. Use a dash instead of an underscore.

    Also, I think the partial helper resolves starting in the templates directory. If you want to store a partial in the components directory, you'll probably have to make that explicit.

    So your file should be named:

    addon/templates/components/-pane.hbs
    

    And your call should look like:

    {{partial 'components/pane'}}