Skip to content

Commit 9e32cc4

Browse files
JeevanMaheshadevversion
authored andcommitted
docs: update comments to use consistent code formatting for boolean values (angular#57619)
PR Close angular#57619
1 parent 326cca2 commit 9e32cc4

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

goldens/public-api/common/index.api.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -536,20 +536,20 @@ export { NgForOf }
536536

537537
// @public (undocumented)
538538
export class NgForOfContext<T, U extends NgIterable<T> = NgIterable<T>> {
539-
// (undocumented)
540539
$implicit: T;
541-
constructor($implicit: T, ngForOf: U, index: number, count: number);
542-
// (undocumented)
540+
constructor(
541+
$implicit: T,
542+
ngForOf: U,
543+
index: number,
544+
count: number);
543545
count: number;
544546
// (undocumented)
545547
get even(): boolean;
546548
// (undocumented)
547549
get first(): boolean;
548-
// (undocumented)
549550
index: number;
550551
// (undocumented)
551552
get last(): boolean;
552-
// (undocumented)
553553
ngForOf: U;
554554
// (undocumented)
555555
get odd(): boolean;

packages/common/src/directives/ng_for_of.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,39 @@ import {RuntimeErrorCode} from '../errors';
2929
*/
3030
export class NgForOfContext<T, U extends NgIterable<T> = NgIterable<T>> {
3131
constructor(
32+
/** Reference to the current item from the collection. */
3233
public $implicit: T,
34+
35+
/**
36+
* The value of the iterable expression. Useful when the expression is
37+
* more complex then a property access, for example when using the async pipe
38+
* (`userStreams | async`).
39+
*/
3340
public ngForOf: U,
41+
42+
/** Returns an index of the current item in the collection. */
3443
public index: number,
44+
45+
/** Returns total amount of items in the collection. */
3546
public count: number,
3647
) {}
3748

49+
// Indicates whether this is the first item in the collection.
3850
get first(): boolean {
3951
return this.index === 0;
4052
}
4153

54+
// Indicates whether this is the last item in the collection.
4255
get last(): boolean {
4356
return this.index === this.count - 1;
4457
}
4558

59+
// Indicates whether an index of this item in the collection is even.
4660
get even(): boolean {
4761
return this.index % 2 === 0;
4862
}
4963

64+
// Indicates whether an index of this item in the collection is odd.
5065
get odd(): boolean {
5166
return !this.even;
5267
}

0 commit comments

Comments
 (0)