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

Update syntax for ids property in DataBehavior to include arrays #305

Open
mandragorn opened this issue Feb 6, 2017 · 1 comment
Open

Comments

@mandragorn
Copy link
Contributor

For properties on objects in an array you have to do the full boiler plate:

      updateEvents: ['behaviors.bill.data:change:receiptMessageRetrievers', 'behaviors.bill.data:fetched:ids'],
      ids: function() {
        var billDataBehavior = this.view.getBehavior('bill');
        var billData = billDataBehavior.data;
        var receiptMessageRetrievers = billData.get('receiptMessageRetrievers');
        return _.pluck(receiptMessageRetrievers, 'id');
      }

Would be nice to do something like:

      ids: { property: 'behaviors.bill.data:receiptMessageRetrievers[].id' }
@mandragorn
Copy link
Contributor Author

possibly drop [] and auto-detect arrays.

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

No branches or pull requests

1 participant