ember.js - Get request params within Ember DS.RESTADAPTER -


i have controller looks this:

export default ember.route.extend({   model: function(params) {     console.log(params);     return this.store.query('workspace', {user: ':uid'});   }  }); 

i need rewrite query url in restadapter:

export default ds.restadapter.extend({     namespace : 'api',     urlforquery: function(query, modelname){         var url = ['api','users', query.user, modelname+'s'];         delete query.user;         var host = 'http://localhost:8080/';         var prefix = this.urlprefix();          url = url.join('/');         if (!host && url && url.charat(0) !== '/') {             url = '/' + url;         }          return host+url;     } }); 

the problem ember requires dashed params passed such here:

 {user: ':uid'} 

so when try access query.user => ':uid' instead of actual value. there way 'controller url params' within adapter parsing query param?


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -