ember.js: dynamic segments and queries -


i have problem resources in ember.js.

given these router:

app.router.map ->   @route "index", path: "/"   @resource "transport_documents", ->     @resource "transport_document", path: ":transport_document_id" 

and routes:

app.transportdocumentsroute = ember.route.extend   model: -> app.transportdocument.find()  app.transportdocumentroute = ember.route.extend   model: (params)->      app.transportdocument.find(params.id) 
  • when navigate /transport_documents server side call is: /api/transport_documents, expected
  • when navigate /transport_documents/1 expect call done: /api/transport_documents/1, it's not. no calls server

is expected situation? if no, should force app doing query? want more details in show view, , less in index.

thanks

params contain dynamic segment name specified. in case need use:

model: (params)->    app.transportdocument.find(params.transport_document_id) 

see this example in ember routing guide more information.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -