Closed terrywarwar closed 8 years ago
try casting the item to dart with convertToDart(item)
.
just tried it, no difference.
@reflectable bool filterItems(item,[_, __])=> convertToDart(item).feederCode == "XT12";
The tests for this functionality are passing, so there must be something else going on. Can you post a more complete repro?
will try and reproduce in a smaller app. btw, can I pass a property into the filter like filter="filterItems(item, text)"
with text being @property String text
?
It looks like you can, but need to wrap it in {{}}
if you do that, https://www.polymer-project.org/1.0/docs/devguide/templates.html#dynamic-sort-and-filter-changes
thanks I'll try it out, what would be the equivalent function in dart, do we pass the item
in@reflectable bool filterItems(item,text)
Tried the same example with a closure
@reflectable computeFilter(t) { return (Employee employee) => employee.last == t; }
convertToDart(employee);
resolved that error.
Ah interesting, but that makes sense. I can think on how the framework might handle this automatically, but its not a trivial use case.
filter
works in small app. You're right something else is going on in larger app. Thanks.
I've got a filter set as below and it's not working. Is there anything else I need to do or import.
<template is="dom-repeat" items="{{data}}" filter="filterItems" observe="feederCode">
@reflectable bool filterItems(item, [_, __])=> item.feederCode == "XT12";