ember.js - Nested object in queryParams -


Question: What type of object can I pass

  query: {id : bla, email: bla-bla-bla}   

in query parameters?

Simple way to do this

  App.ArticlesController = Ember ArrayController.extend ({queryParams: ['query'], query: {id: bla, email: bla -bla-bla}});   

does not work, of course :)

P.S. Sorry for bad english :)

The amber query parameter sets an object as a query paragraph Does not support It only supports key-value pairs:

What is the query parameter added to the right-key that appears on the right? For example in the URL, the following URL contains two query parameters, sort and page, ASC with respective values ​​and 2:

if you type both id and < In the query stringing code> code> email properties, you must specify it explicitly:

  App.ArticlesController = Ember.ArrayController.extend ({queryParams: ['id, email '], Id: blank, email: null});   

If you really want to add id and email directly to the query object, then you You can set up a supervisor or calculated property (depending on your goal) which will be updated locally by you in id or email or any other item Does.

If you want to streamline this setup, you might want to consider using a controller mixer that defines the corresponding set properties in the equivalent set properties in your query parasions. You will be able to do something like this:

  App Article Controller = Ember.ArrayController.extend (MyQueryParamsMixin, {queryParams: myQueryParams // Other properties explicitly in your Mixin / technologically, you do not have to declare the properties because they are recovered / thanked in any way // Thanks for asking the parameters, but the readers of your mixin have a good practice to find out which properties are in use //});    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -