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

[RFR] Add <ma-filtered-list-button> directive #339

Merged
merged 3 commits into from
Mar 6, 2015

Conversation

fzaninotto
Copy link
Member

A reusable directive to automatically link to a prefiltered list.

Usage:

post.editionView()
    .fields([
        nga.field('comments', 'referenced_list')
            .targetEntity(comment)
            .targetReferenceField('post_id')
            .targetFields([
                nga.field('id'),
                nga.field('body').label('Comment')
            ]),
        nga.field('', 'template').label('')
            .template('<ma-filtered-list-button entity-name="comments" filter="{ post_id: entry.values.id }" size="sm">')

image

Refs #338

@fzaninotto
Copy link
Member Author

I'm wondering about the syntax. It would be more powerful to accept a filter object:

<ma-filtered-list-button entity-name="comments" filter="{ post_id: entry.values.id }" text="" size="sm"></ma-filtered-list-button>

What do you think?

@jeromemacias
Copy link
Contributor

I'm 👍 for the filter attribute accepting an object.
As a bonus, the directive code will be simpler (as the object may be pass directly to the route).

@fzaninotto
Copy link
Member Author

Switched to an object-based filter attribute, RFR again.

jeromemacias added a commit that referenced this pull request Mar 6, 2015
[RFR] Add <ma-filtered-list-button> directive
@jeromemacias jeromemacias merged commit ecde8ba into master Mar 6, 2015
@jeromemacias jeromemacias deleted the ma-filtered-list-button branch March 6, 2015 21:36
@yaoelvon
Copy link

very nice, this helps me! Thanks a lot.

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

Successfully merging this pull request may close these issues.

3 participants