I have my original working code from angular1 as following:
<div align="center" ng-show="showWords" >
<div ng-repeat="word in whichArray | limitTo:limitToMain" ng-if="$index % 2 == 0" class="row">
<div class="col" align="right" style="margin-right:1cm;"><h3>{{whichArray[$index]}}</h3></div>
<div class="col" align="left" style="margin-left:1cm;"><h3>{{whichArray[$index + 1]}}</h3></div>
</div>
</div>
When I try to convert it into angular2 code following:
<div align="center" *ngIf="showWords" >
<div *ngFor="let word of whichArray | limitTo:limitToPresent" *ngIf="$index % 2 == 0" class="row">
<div class="col" align="right" style="margin-right:1cm;"><h3>{{whichArray[$index]}}</h3></div>
<div class="col" align="left" style="margin-left:1cm;"><h3>{{whichArray[$index + 1]}}</h3></div>
</div>
</div>
I get Can't have multiple template bindings on one element. Use only one attribute named 'template' or prefixed with *
error. I have created a pipe called limitTo.
How to fix this error?