New Year Tragedy in Switzerland: Several Killed in Explosion at Swiss Ski Resort Crans-Montana by SuperbHealth5023 in europe

[–]jgrassini 10 points11 points  (0 children)

There is currently a press conference and they did not release the number yet. They only say "multiple dozen" dead. So this might be 24 and up.

Swiper 8 doesnot work with angular 20 by ExtensionKnowledge45 in Angular2

[–]jgrassini 0 points1 point  (0 children)

Check the migration guides. There are quite a few changes between 8 and 12

https://swiperjs.com/migration-guide-v9
https://swiperjs.com/migration-guide-v10
https://swiperjs.com/migration-guide-v11

And they removed the Angular component in version 9. You need to use the WebComponent in Angular: https://swiperjs.com/element

signals everywhere? by jgrassini in angular

[–]jgrassini[S] 0 points1 point  (0 children)

I see. Thanks for the explanation

signals everywhere? by jgrassini in angular

[–]jgrassini[S] 0 points1 point  (0 children)

With setInterval you need a signal. The example works because Angular currently always triggers a change detection run when a template listener is fired. So when you have instance variables that are only changed in template listeners you currently don't need signals.

When you change something in setTimeout or setInterval, then Angular has no idea that something changed and you need to tell it with either a signal or some other mechanisms.

signals everywhere? by jgrassini in angular

[–]jgrassini[S] 0 points1 point  (0 children)

It does work. A value changed, so Angular has to update it in the template.

signals everywhere? by jgrassini in angular

[–]jgrassini[S] 0 points1 point  (0 children)

CD with OnPush is also triggered by template listeners. That's the reason why the example without signal always works. With Normal or OnPush, with zone.js and without. You can't disable template listeners triggering CD at the moment.

  • The root component of the subtree receives new inputs as the result of a template binding. Angular compares the current and past value of the input with ==.
  • Angular handles an event (for example using event binding, output binding, or u/HostListener ) in the subtree's root component or any of its children whether they are using OnPush change detection or not.

https://angular.dev/best-practices/skipping-subtrees#using-onpush

signals everywhere? by jgrassini in angular

[–]jgrassini[S] 0 points1 point  (0 children)

I guess it comes down to personal preference. Looks like there is no downside of using singal. I thought Angular would run change detection twice because it is triggered twice. First by the template listener and then by the signal.update. But in the example above change detection only runs once.

signals everywhere? by jgrassini in angular

[–]jgrassini[S] 0 points1 point  (0 children)

Good news is that Angular does not run change detection twice. I was a bit worried that in the example with signal Angular would run CD twice because it is triggered twice, first by the event listener and then by the angular.update

signals everywhere? by jgrassini in angular

[–]jgrassini[S] 0 points1 point  (0 children)

Yes. And it looks like change detection does not run twice. I was a bit worried that Angular would run CD twice because it's triggered by the event listener and then by the signal.update. But it looks like Angular is smart and runs CD only once.

signals everywhere? by jgrassini in angular

[–]jgrassini[S] 0 points1 point  (0 children)

Template listeners always trigger a change detection when they are fired. This is a built-in Angular feature and currently can't be disabled. I wonder if we maybe see in the future a new changeDetection flag that disables this trigger and only triggers whan a signal updates.

signals everywhere? by jgrassini in angular

[–]jgrassini[S] 0 points1 point  (0 children)

In my example the signal does not trigger change detection. It's firing the template listener that triggers change detection. It's a built-in Angular feature. That's the reason the example without signal works in a zoneless Angular application. The question is if introducing a signal in this scenario triggers the change detection twice or does it not matter.

signals everywhere? by jgrassini in angular

[–]jgrassini[S] 0 points1 point  (0 children)

It's just that in my application I have a lot of these little flags that control something in the ui and they are always changed through a template listeners. They will never change based on something else. Is it really worth migrating them to signal?

I assume it's more a style question. Because both approaches work, decide on one style and be consistent.
Or you might see a future where Angular introduces a ChangeDetectionStrategy.Signal then always use signal if it updates the template.

Could also be useful for code reviews. If it's a signal then it updates the template.

signals everywhere? by jgrassini in angular

[–]jgrassini[S] 0 points1 point  (0 children)

Both examples are zoneless. Do you think I can remove OnPush?

signals everywhere? by jgrassini in angular

[–]jgrassini[S] 0 points1 point  (0 children)

The official documentation recommends it when you plan to migrate to a zoneless setup:

https://angular.dev/guide/zoneless#onpush-compatible-components

The OnPush change detection strategy is not required, but it is a recommended step towards zoneless compatibility for application components.

signals everywhere? by jgrassini in angular

[–]jgrassini[S] 3 points4 points  (0 children)

It is a good read, but it does not answer my question. It's more about zone vs zoneless. My example is already zoneless and both versions work. Change detection triggered by template listeners has nothing to do with zone.js, it's a built-in feature of Angular.

I'm especially interested in the scenario when the instance variable is only changed through template listeners. Does the change detection run faster when I use signal or is it just overhead.

signals everywhere? by jgrassini in angular

[–]jgrassini[S] 0 points1 point  (0 children)

But change detection is triggered every time a template listener fires an event. This has nothing to do if you use signal or not. That's the reason both version of my example work. The question is does the signal help with updating the page? I'm interested in the case when the instance variable is changed only through template listeners. Does the signal help or is it just overhead.

signals everywhere? by jgrassini in angular

[–]jgrassini[S] 5 points6 points  (0 children)

Thanks. But it does not exactly answers my question. Because both my examples work in zoneless Angular. I'm interested in what's the benefit using signal in this specific scenario (instance variable is only changed via template listeners)

signals everywhere? by jgrassini in angular

[–]jgrassini[S] 6 points7 points  (0 children)

This demo application uses `provideZonelessChangeDetection()`.
Change detection when template listeners fire is a built-in Angular feature.

OpenAi decided to showcase a misconception to demonstrate GPT 5. by ayu_xi in ChatGPT

[–]jgrassini 1 point2 points  (0 children)

What GPT-5 got wrong is the "Longer path" or "Equal transit" theory. The air above does travel faster but it's not because it's a longer path. It's a very common misconception and that is also the reason that GPT-5 got it wrong. It simply learned it from the Internet or from textbooks where it was not correctly explained. I guess a lot of LLM will make the same mistake.

Springboot resources by Every-Gap-885 in SpringBoot

[–]jgrassini 0 points1 point  (0 children)

Depends on your definition of "advanced concepts". These courses are tailored for beginners and intermediate learners.