Skip to main content
2 votes

Rxjs concatMap that resolves to switchMap

Take this approach instead : private cache = new BehaviorSubject<any>(undefined); public cache$ = this.cache.asObservable().pipe( filter(Boolean); ); loadData() { if (this.cache.value) ...
MGX's user avatar
  • 3,111
2 votes
Accepted

ng not found error when building Angular project using dockerfile

You shouldn't use the latest tag of the node image with Angular projects. Angular only supports the LTS version. In the stable channel some changes might be made which Angular first needs to adapt for....
JSON Derulo's user avatar
  • 13.2k
2 votes

Angular Signals: How to trigger an effect based on a signal without using its value?

You can use toObservable() to convert the signal to an Observable: constructor() { toObservable(this.authService.userAuthorized) .pipe(takeUntilDestroyed()) .subscribe(() => this....
JSON Derulo's user avatar
  • 13.2k
1 vote

Angular Signals: How to trigger an effect based on a signal without using its value?

I couldn't find a better way other than to either use the toObservable() as mentioned by @JSONDerulo or to trigger the signal getter inside the effect(). However you could define a named effect ...
Michael D's user avatar
  • 30.7k
1 vote
Accepted

Angular Signals inside effect()

You can just use toObservable for this. To Convert to observable then use switchMap to switch to the API observable you need, this will react when the signal changes. item_id = input<string>();...
Naren Murali's user avatar
  • 41.6k
1 vote

Replacing a nested subscribe when getting multiple details from one initial call for ids

My approach involves using switchMap and forkJoin. First we use the observable to get all the ID fields, then we can use switchMap to switch from outer observable to inner observable. I then convert ...
Naren Murali's user avatar
  • 41.6k
1 vote

How to use the retry from Rxjs to my await function?

You can use this article code which seems to be exactly what you need. It has support for number of retries and custom error message. import './style.css'; let i = 0; const promiseFn = () => { ...
Naren Murali's user avatar
  • 41.6k
1 vote
Accepted

How to extract colors from a palette in Material 3

You can use mat.get-theme-color for this. Full Detailed Docs for get-theme-color background-color: mat.get-theme-color($theme, primary, 50) !important; We should also be aware of the number ranges ...
Naren Murali's user avatar
  • 41.6k
1 vote

Angular 18 SSR Vercel issue with 404

I made it work..... api/index.js export default import('../dist/project/server/server.mjs') .then(module => module.app()); vercel.json { "version": 2, "public": true, &...
The Segfault's user avatar
  • 1,021
1 vote
Accepted

Firefox | HTMLVideoElement currentTime 0 after executing play()

It seems like you are currently relying on the Chrome specific implementation of the .play() function, where the currentTime is greater than 0 right after the function was called. But there is no ...
JSON Derulo's user avatar
  • 13.2k
1 vote
Accepted

Component init inside ng bootstrap accordion even if closed

UPDATE: The problem was that the accordion body content must be wrapped in an ng-template since this was not done, the content is getting rendered even when the accordion is not open. The same method ...
Naren Murali's user avatar
  • 41.6k
1 vote
Accepted

Combines Angular Material table-expandable-rows and table-wrapped, and adds custom expand details but cannot show the custom detail content

When I changed ContentChild to @ContentChild('temp', { read: TemplateRef, }) template: TemplateRef<any>; It started working, so we need to be specific with the selector. Also promote ...
Naren Murali's user avatar
  • 41.6k
1 vote

Rxjs concatMap that resolves to switchMap

Looks too complicated, you can convert the promise to an observable using from and then use share to cache the value. There is no need for the behaviour subject. test$ = new BehaviorSubject<any[] | ...
Naren Murali's user avatar
  • 41.6k

Only top scored, non community-wiki answers of a minimum length are eligible