Skip to main content

NgtPush

NgtPush is similar to Angular's AsyncPipe. The difference is NgtPush works with a CD-detached environment like NGT.

<!-- might not work because Change Detection doesn't run -->
<ngt-box-geometry *args="args$ | async" />
<!-- ensures Change Detection triggers on changes -->
<ngt-box-geometry *args="args$ | ngtPush" />

Default Value

NgtPush accepts a default value for the first emission.

<!-- make a box of [2, 2, 2] by default -->
<ngt-box-geometry *args="args$ | ngtPush: [2, 2, 2]" />