netpoetica
netpoetica

Reputation: 3425

Emberjs Index vs Application

I cannot grok or find proper documentation for elaborating on Emberjs' "application" and "index" view/controller/template. Are they interchangeable?

For example,

App.Router.map(function(){
  this.resource('index', { path: '/' });
});

When I navigate to the root URL, it renders the "application" template and the context is "application" controller - meanwhile, I have specifically named the resource Index. My expectation is that it would then use the "IndexView" and "IndexController".

Can anyone clarify these things or point me in the direction of good documentation?

Upvotes: 1

Views: 264

Answers (1)

Arnaud Gourlay
Arnaud Gourlay

Reputation: 4666

I think you miss the concept of "outlet" to fully understand what is going on.

In your application, the resources are injected in the application template via an injection point called outlet.

Just add {{outlet}} in your application template.

See here for doc http://emberjs.com/guides/application/the-application-template/

Upvotes: 2

Related Questions