Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Ember Data collections #11

Closed
wants to merge 1 commit into from
Closed

Add support for Ember Data collections #11

wants to merge 1 commit into from

Conversation

ioleo
Copy link

@ioleo ioleo commented Jun 23, 2016

Fixes #5

I've hacked around a little bit and this small change was enough to get it working with

Route:

import Ember from 'ember';

export default Ember.Route.extend({
  model() {
    return this.store.findAll('user');
  }
});

Template:

<h2>Users:</h2>

<div class="container-fluid">
{{#filter-content content=model properties="name" placeholder="Filter..." inputClassNames="form-control" as |fc|}}
    <small class="{{if fc.query '' 'invisible'}}">
        Showing{{fc.filteredContent.length}} from {{fc.content.length}} users
        <strong>"{{fc.query}}"</strong>
    </small>
    {{#each fc.filteredContent as |user|}}
        <div class="row">
            <div class="thumbnail">
                <img src="{{user.image}}" alt="...">
                <div class="caption">
                    <h3>{{user.name}}</h3>
                </div>
            </div>
        </div>
    {{/each}}
{{/filter-content}}
</div>

{{outlet}}

@ioleo
Copy link
Author

ioleo commented Jun 23, 2016

@zakmac If you merge this, please tag another minor release, so I can lock on it (instead of haveing a modified vendor).

@zakmac
Copy link
Owner

zakmac commented Sep 30, 2016

Hey @loostro thank you for submitting your fix. It will unfortunately not be merged into the development branch due to the implementation having the possibility of false positives as any object could have a property labeled content.

Effort has been made in the latest release to support Ember.Data collections and in v3.1.0 should have further support added.

@zakmac zakmac closed this Sep 30, 2016
@ioleo ioleo deleted the patch-1 branch October 3, 2016 13:56
@ioleo
Copy link
Author

ioleo commented Oct 3, 2016

@zakmac True, that was just a temporary workaround and should be replaced by a more reliable way of telling a collection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants