1
votes

I'd like to build something similar to Google search, where at the top there are different filters (text search, filter by time...). At the bottom user can have different views, so web search, image search, video search...

I imagine that the bottom views will be different ember controllers. Here is a sample jsFiddle. I have two controllers, a web and an image, both getting data from Navigation controller.

http://jsfiddle.net/FMk7R/

My Navigation controller

App.NavigationController = Ember.ObjectController.extend({
    search: ''
});

Other controllers would get the information and act on it.

App.SearchController = Ember.ObjectController.extend({
    needs: ['navigation'],

    updateResults: function () {
        return this.get('controllers.navigation.search');
    }.property('controllers.navigation.search')
});

I'd like to put those filters into querystring, so the url can be passed around. How can I achieve something like:

http://myApp/#/web?find=someText&date=lastMonth
http://myApp/#/image?find=otherText&date=lastYear

Can this be done in ember?

2

2 Answers

0
votes

At the moment it is unsupported but there are plans to implement support in the future - see a recent issue on their github page. One of the replies in that thread have even implemented their own support in the meantime, so perhaps that is worth looking into.

0
votes

I have just released a library for this, however it only works for history location at the moment. See https://github.com/alexspeller/ember-query