Live filter with items list


#1

Hi all.

What iā€™m trying to do is almost like this one

But no luck :worried:

What i have is a basic input {{ input type="text" value=filterSearch class="form-control input-sm search" placeholder='search...' }}

And a controller

 import Ember from 'ember';

export default Ember.ArrayController.extend({
	sortProperties:["url"],
  	sortAscending: true,

  	searchResult: function(){
        var searchTerm = this.get('filterSearch');
        var regExp = new RegExp(searchTerm,'ig');

        this.set('model',this.store.filter('site',function(item){
        	console.log(item.get('url').match(regExp));
            return item.get('url').match(regExp);
        }));

    }.observes('filterSearch'),

	
});

View

    {{#each item in model}}
{{#link-to 'sites.index.show' item.id class="list-group-item media"}}

    <div class="pull-left">
        <span class="fa-stack fa-lg">
        <i class="fa fa-circle fa-stack-2x text-info"></i>
        <i class="fa fa-cloud fa-stack-1x text-white"></i>
        </span>
    </div>

    <div class="media-body">
        <div class="note-name">
        	<strong>{{item.url}}</strong>
        </div>
        <div class="note-desc">{{item.title}}</div>
         <span class="text-xs text-muted"><span class="label bg-info">Created: {{ ago item.created_at }}</span>  <span class="label bg-info">Updated: {{ ago item.updated_at }}</span></span>
    </div>
{{/link-to}}
{{/each}}

Console.log() shows input, but items list not changes at all.