I have two functionalities of a text-box. First, it displays a filtered data on enter press or pressing on the search button and second filter happens if you type anything in the textbox and accordingly it filters and displays the result from the filtered data result.
Error is -
Parser Error: Bindings cannot contain assignments at column 32 in
[arrayCount1 of ctrl.filtered = (result| filter: query)]
I understood the error but how to get the number from already filtered data count.Do i have to do something in .ts file.
The code for it is -
transaction.component.html
<td style="width:50%">
<input class="form-control" id="input1-group1 "
style="margin-top:20px" type="text" name="search"
placeholder="Enter Search Text"
[(ngModel)]="filterdata"
(keyup.enter)="searchByText(filterdata)">
</td>
<td style="width:50%">
<button type="submit" class="input-group-addon"
style="margin-left:0px;width:65px;margin-top:20px" id="faIcon"
(click)="searchByText(filterdata)" >
<i class="fa fa-search "></i>
</button>
</td>
....//code
<div class="panel panel-default panel-transparent">
<div class="panel-heading text-left">
<h2> Transaction </h2>
<label *ngIf="toShowCount" id="arrayCountId"> Number of searched
data : {{arrayCount}}</label>
<ul>
<li *ngFor = "arrayCount1 of ctrl.filtered = (result| filter:
query)"
id="arrayCountId">Number of filtered search data : {{arrayCount1}}
</li>
</ul>
</div>
</div>
transaction.component.ts
this.http.post("http:...)
.map(result => this.result = result.json())
.subscribe((res: Response) => {
this.records = res;
this.toShowCount =true;
this.arrayCount = this.result.length;
console.log("ArrayCount = " , this.arrayCount)
I have a link to a similar question but in AngularJS :