diff --git a/apps/demos/src/app/features/template/rx-let/ng-if-hack/ng-if-hack-rx-let.component.ts b/apps/demos/src/app/features/template/rx-let/ng-if-hack/ng-if-hack-rx-let.component.ts
index 28d3940e39..d2bd683d39 100644
--- a/apps/demos/src/app/features/template/rx-let/ng-if-hack/ng-if-hack-rx-let.component.ts
+++ b/apps/demos/src/app/features/template/rx-let/ng-if-hack/ng-if-hack-rx-let.component.ts
@@ -19,7 +19,7 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
let value;
suspense: suspenseView;
error: errorView;
- rxComplete: completeView
+ complete: completeView
"
>
value: {{ value | json }}
diff --git a/apps/demos/src/app/features/template/rx-virtual-for/virtual-rendering/virtual-for-reverse-infinite-scroll.component.ts b/apps/demos/src/app/features/template/rx-virtual-for/virtual-rendering/virtual-for-reverse-infinite-scroll.component.ts
index 2de8ac0f7e..64baef54a6 100644
--- a/apps/demos/src/app/features/template/rx-virtual-for/virtual-rendering/virtual-for-reverse-infinite-scroll.component.ts
+++ b/apps/demos/src/app/features/template/rx-virtual-for/virtual-rendering/virtual-for-reverse-infinite-scroll.component.ts
@@ -200,7 +200,6 @@ import { Message, MessageService } from './messages/messages.service';
DatePipe,
MatButtonToggleModule,
MatInputModule,
- RxIf,
RxLet,
StrategySelectModule,
FixedSizeVirtualScrollStrategy,
diff --git a/apps/demos/src/app/shared/debug-helper/value-provider/primitives-provider.service.ts b/apps/demos/src/app/shared/debug-helper/value-provider/primitives-provider.service.ts
index f26c78a69d..9970d7dfd9 100644
--- a/apps/demos/src/app/shared/debug-helper/value-provider/primitives-provider.service.ts
+++ b/apps/demos/src/app/shared/debug-helper/value-provider/primitives-provider.service.ts
@@ -1,13 +1,26 @@
-import { ChangeDetectorRef, Injectable } from '@angular/core';
+import {
+ ChangeDetectorRef,
+ inject,
+ Injectable,
+ Injector,
+ runInInjectionContext,
+} from '@angular/core';
import { RxState } from '@rx-angular/state';
import { merge, Observable, Subject } from 'rxjs';
import { map, scan } from 'rxjs/operators';
import { ngInputFlatten } from '../../utils/ngInputFlatten';
import { ProvidedValues } from './model';
-import { toBoolean, toImgUrl, toInt, toRandom, withCompleteAndError } from './utils';
+import {
+ toBoolean,
+ toImgUrl,
+ toInt,
+ toRandom,
+ withCompleteAndError,
+} from './utils';
@Injectable()
export class PrimitivesProviderService {
+ private injector = inject(Injector);
protected outerChanges = new Subject>();
protected nextSubject = new Subject();
@@ -16,7 +29,7 @@ export class PrimitivesProviderService {
protected error$ = this.errorSubject.pipe(
map((_) => {
throw new Error('ERROR');
- })
+ }),
);
protected completeSubject = new Subject();
protected resetSubject = new Subject();
@@ -47,31 +60,34 @@ export class PrimitivesProviderService {
private resetObservables = () => {
this.state.ngOnDestroy();
- this.state = new RxState();
+ runInInjectionContext(
+ this.injector,
+ () => (this.state = new RxState()),
+ );
this.state.connect(
'random',
merge(this.nextSubject, this.outerChanges.pipe(ngInputFlatten())).pipe(
- map(toRandom)
- )
+ map(toRandom),
+ ),
);
this.float$ = this.state.select('random');
this.int$ = this.state.select(
map((s) => toInt(s.random, this.min, this.max)),
- withCompleteAndError(this.error$, this.completeSubject)
+ withCompleteAndError(this.error$, this.completeSubject),
);
this.incremental$ = this.state.select(
scan((inc) => ++inc, 0),
- withCompleteAndError(this.error$, this.completeSubject)
+ withCompleteAndError(this.error$, this.completeSubject),
);
this.boolean$ = this.state.select(
map((s) => toBoolean(s.random, this.truthy)),
- withCompleteAndError(this.error$, this.completeSubject)
+ withCompleteAndError(this.error$, this.completeSubject),
);
this.imgUrl$ = this.state.select(
map((s) => toImgUrl(s.random)),
- withCompleteAndError(this.error$, this.completeSubject)
+ withCompleteAndError(this.error$, this.completeSubject),
);
this.state.hold(this.float$, this.updateStatic);
@@ -86,7 +102,7 @@ export class PrimitivesProviderService {
constructor(
protected state: RxState,
- protected cdRef: ChangeDetectorRef
+ protected cdRef: ChangeDetectorRef,
) {
this.resetAll();
}