-
Notifications
You must be signed in to change notification settings - Fork 475
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(demo): documentation page
Dropdown
has infinite SSR (#7089)
- Loading branch information
1 parent
0583029
commit f75d810
Showing
2 changed files
with
4 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
19 changes: 3 additions & 16 deletions
19
projects/demo/src/modules/directives/dropdown/examples/3/index.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,19 @@ | ||
import {ChangeDetectorRef, Component, inject} from '@angular/core'; | ||
import {Component} from '@angular/core'; | ||
import {changeDetection} from '@demo/emulate/change-detection'; | ||
import {encapsulation} from '@demo/emulate/encapsulation'; | ||
import {TuiDestroyService, tuiWatch} from '@taiga-ui/cdk'; | ||
import {interval, takeUntil} from 'rxjs'; | ||
import {interval, map} from 'rxjs'; | ||
|
||
@Component({ | ||
selector: 'tui-dropdown-example-3', | ||
templateUrl: './index.html', | ||
styleUrls: ['./index.less'], | ||
encapsulation, | ||
changeDetection, | ||
providers: [TuiDestroyService], | ||
}) | ||
export class TuiDropdownExample3 { | ||
protected open = false; | ||
|
||
protected value = 'some data'; | ||
|
||
protected showBigText = false; | ||
|
||
constructor() { | ||
interval(3000) | ||
.pipe( | ||
tuiWatch(inject(ChangeDetectorRef)), | ||
takeUntil(inject(TuiDestroyService, {self: true})), | ||
) | ||
.subscribe(() => { | ||
this.showBigText = !this.showBigText; | ||
}); | ||
} | ||
protected showBigText$ = interval(3000).pipe(map(i => !(i % 2))); | ||
} |