How to access getter/setter accessors from angular 4 in template binding?
问题 Lets say I have the following getter/setter methods get next() { console.log(this.people[this._index], this._index); return this.people[this._index]; } set next(i: any) { this._index = (+i) + 1; this._index = (+i) % this.people.length; } and I want to call this in the following way: <ng-template ngFor let-person="$implicit" [ngForOf]="people" let-i=index let-last=last> <app-card [cardItem]="people[i]" [nextCard]="next(i)"></app-card> </ng-template> PS: Think of this as circular array. Where