Skip to content

Commit

Permalink
chore(demo): documentation page Dropdown has infinite SSR (#7089)
Browse files Browse the repository at this point in the history
  • Loading branch information
nsbarsukov authored Mar 26, 2024
1 parent 0583029 commit f75d810
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<code>polymorpheus</code>
directive on the template to make changes propagate both ways
</p>
<p *ngIf="showBigText">
<p *ngIf="showBigText$ | async">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab assumenda at corporis ea hic illo ipsa
laboriosam laudantium nemo neque officiis pariatur quidem quos rerum sunt, temporibus tenetur ullam vitae?
</p>
Expand Down
19 changes: 3 additions & 16 deletions projects/demo/src/modules/directives/dropdown/examples/3/index.ts
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)));
}

0 comments on commit f75d810

Please sign in to comment.