Created
July 8, 2019 05:23
-
-
Save alexzuza/bc24f6ddcacf0fad1b944ca5fb88341e to your computer and use it in GitHub Desktop.
t19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class NgForOfContext<T> { | |
constructor( | |
public $implicit: T, public ngForOf: NgIterable<T>, public index: number, | |
public count: number) {} | |
get first(): boolean { return this.index === 0; } | |
get last(): boolean { return this.index === this.count - 1; } | |
get even(): boolean { return this.index % 2 === 0; } | |
get odd(): boolean { return !this.even; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment