feat(ng_for): Add Even and Odd variables to ng_for
Add even and odd local variables to ng_for to allow developers to style table rows differently and other features. Closes #4181
This commit is contained in:
@ -90,6 +90,8 @@ export class NgFor implements DoCheck {
|
||||
private _perViewChange(view, record) {
|
||||
view.setLocal('\$implicit', record.item);
|
||||
view.setLocal('index', record.currentIndex);
|
||||
view.setLocal('even', (record.currentIndex % 2 == 0));
|
||||
view.setLocal('odd', (record.currentIndex % 2 == 1));
|
||||
}
|
||||
|
||||
static bulkRemove(tuples: RecordViewTuple[], viewContainer: ViewContainerRef): RecordViewTuple[] {
|
||||
|
Reference in New Issue
Block a user