With the following problem I got stuck now for days. My use case is that I have a database with millions of addresses. From an web-application I would like to search them, d
I've got URL that contains information about news page number and depending on this it sends and ajax call. My router looks like:
App.Router.map(function() {
this.resource('news', { path: '/n/:id' });
});
But you could also do it like:
App.Router.map(function() {
this.resource('searchresults', { path: '/searchresults/:lastname/:firstname/:city' });
});
And your URL would look like this:
http://localhost/#/searchresults/king/stephen/somecity
Then you just specify:
App.SearchresultsRoute = Em.Route.extend({
model: function(params) {
var lastname = params.lastname;
var firstname = params.firstname;
var city = params.city;
someFunction(lastname, firstname, city);
}
});
I hope my answer helped you. Have a nice day!