Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4836

Query Parameters Again

$
0
0

@Ben_Glancy wrote:

Hi,

I repeatedly run into issues with QueryParameters.

I have used them, I’ve even got them used in my project - not with the renderTemplate hook in a route admittedly, but they have worked in the normal case. But yet I’ll add another one and then get right back into issues again to the point of banging my head against the wall.

I have a route that overrides the renderTemplate() hook:

> this.render('user.companies.default.controller-submit', {
> 			  controller: 'user.companies.default.controller-submit',
> 			  model: model
> 			});

Inside controller-submit, (which does get called because I’ve tested that init() gets called as below), I have:

> queryParams: [
> 		'as2' 
> 	],
> 	as2:null ,
> 	init() {
> 		 this._super();
> 		 alert("in"+this.get('as2'));
> 	}

This in a child route of another route that also has its own query params declared.

Then in the browser, I try to go to this submit route:
http://localhost:4200/roomviewer-dreamdoors/159/submit?as2=37

Except the messagebox in the code above always says “null”. I have tried passing the as2 value to a component as well (binding to it) and the component also says:“null”. So its not that init() is trynig to access it too early necessarily.

Is it the rendertemplate() that is ruining my life here? Is it not set up properly to use query params

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4836

Trending Articles