Eric
Eric

Reputation: 1020

When should a route be used in Ember?

I am very, very new to EmberJS. I have done some self-teaching exercises to try to familiarize myself with the technology.

One question I have is why in the Ember ToDo application (http://jsbin.com/aZIXaYo) there isn't a specific route for editing a todo? Looks like a double click on a todo puts it into an editing state.

There also seems to be no specific route for adding a todo.

I guess, in general, I'd like to know when I should use a dedicated route and when I don't need to?

Thanks...

Upvotes: 2

Views: 41

Answers (1)

James_1x0
James_1x0

Reputation: 931

Essentially, with each data model, you need a different route. So, /todos is a single route. A editing mode is usually a "partial" rendered after a state changes... or just some handlebars logic.

If you haven't watched it yet, watch Tom Dale build an app: http://emberjs.com/guides/ on the guides intro page. It's a good start

Upvotes: 1

Related Questions