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) ...
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....
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....
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 ...
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>();...
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 ...
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 = () => {
...
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 ...
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,
&...
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 ...
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 ...
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 ...
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[] | ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
angular × 305792typescript × 74078
javascript × 52820
html × 20397
angular-material × 15218
rxjs × 14009
css × 12295
ionic-framework × 12171
node.js × 9618
firebase × 6107
observable × 6060
angular-cli × 5950
ionic2 × 5766
angular6 × 5075
json × 4666
angular-reactive-forms × 4560
angular2-routing × 4339
npm × 4222
unit-testing × 4188
ionic3 × 4169
angular5 × 4139
primeng × 4088
jasmine × 3881
ngrx × 3872
angularjs × 3857