Error:
Error: Template parse errors: Parser Error: Bindings cannot contain assignments at....
line:
<div>Closed: {{blah}}.find()
...
HTML:
<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="4px">
<div>Total: {{(issuesData$ | async)?.length}}</div>
<div>Closed: {{(issuesData$ | async)?.filter(data => {data.closedOn}).length}}</div>
</div>
I'm curious if it is possible to use find/filter without running into the template parse error when find/filter are called on a collection in the interpolation statement.
EDIT: Angular 2 - Bindings cannot contain assignments - This does not work for me because I'm passing in an Observable to the component. OnInit I assign the @Input data variable to the issuesData$ observable. Using something like {{getCount()}} in the interpolation results in no data. I tried implementing that like this:
ANGULAR:
@Input()
data;
ngOnInit() {
this.issuesData$ = this.data;
}
getCount(){
this.issuesData$.subscribe(data => {
return data.length;
})
}
HTML:
<div>Total: {{getCount()}}</div>
But there is nothing to subscribe to when the getCount()
is called in the interpolation and this doesn't work either {{(getCount() | async}}