1

I have a template templates/articles.hbs with the code:

{{view "carousel"}}

The above statement must be correct, as it is stated in the Getting Started: https://github.com/stefanpenner/ember-app-kit/wiki/Getting-Started#resolving-from-template-helpers

At views/carousel.js the simple code:

var CarouselView = Ember.View.extend({    
    classNames: ['carousel']
});
export default CarouselView;

This causes however the following error:

Assertion failed: Unable to find view at path 'carousel' ember.js:3231
Assertion failed: You must pass a view to the #view helper, not carousel () 

I have tried to add carousel.js to views/articles/carousel.js. I have tried different {{view}} names such ass App.CarouselView etc, but that all does not work.

What are I am missing here guys?

DelphiLynx
  • 911
  • 1
  • 16
  • 41

1 Answers1

2

In the guides it says you have to pass a view class to the view helper, so does the error message. The wiki might be outdated.

Also I think you've mistakenly defined var CarouselView = instead of App.CarouselView = ...

Thomas Brus
  • 931
  • 5
  • 11
  • Hi, did you see I use Ember App Kit? The code you mention is the syntax used by ES6 module transpiler. – DelphiLynx Jan 08 '14 at 14:19
  • 1
    Sorry no I didn't notice ;) Try restarting the grunt server. That did it for me. The syntax was indeed correct – Thomas Brus Jan 08 '14 at 14:51
  • Wow, what a laughing moment is this... Restarted grunt, and hey it works! You need to know that I was trying for hours to get this working. You Saved My Day! :) – DelphiLynx Jan 08 '14 at 15:15
  • Quick note, if your view has two words, like `NavBarView` you use it with it hyphenated in your template, like `{{view "nav-bar"}}` – jakecraige Feb 09 '14 at 22:01