Salah Eddine Taouririt
Salah Eddine Taouririt

Reputation: 26465

Why shoud I use resource instead of route?

It seems that the only difference between using resource and route is the naming inheritance since both of them support route nesting.

Any other reasons why resource is still in ?

Upvotes: 1

Views: 85

Answers (1)

Buck Doyle
Buck Doyle

Reputation: 6397

Sam Selikoff argues in Future-proofing your Ember 1.x code:

Use this.route instead of this.resource in Router.map

Mitch Lloyd presents some reasons in favour of resource over route, mostly that the former reset the namespace, which he suggests makes for

  • simpler directory structure
  • simpler link-to paths

For more discussion on this, see the Gist thread.

It’s unclear to me whether resource routes are actually disappearing in Ember 2.0, I can’t find official mention of it.

Upvotes: 2

Related Questions