r/javascript • • Nov 05 '14

AngularJS: The bad parts

http://larseidnes.com/2014/11/05/angularjs-the-bad-parts/
87 Upvotes

88 comments sorted by

View all comments

Show parent comments

1

u/leolin520 Nov 05 '14

Wpf or any xaml stack doesn't use digest loop.

1

u/lord2800 Nov 05 '14

Care to explain how it updates the UI with the current state of the data model then?

1

u/leolin520 Nov 06 '14

The UI element binds to a property through an interface, when the property gets set, it fires an event, by which the UI gets notified, it then reevaluates the property by its accessor to get the new value. This is the basic idea, implementation detail you can look at dependency object, dependency property and binding classes.

1

u/lord2800 Nov 06 '14

That's a "digest loop". And that's also not how it works. From Wikipedia:

Periodically, MIL walks the tree and executes the rendering instructions in each node, thus compositing each element on to a DirectX surface, which is then rendered on screen.

...

All WPF applications start with two threads: one for managing the UI and another background thread for handling rendering and repainting.

http://en.wikipedia.org/wiki/Windows_Presentation_Foundation

1

u/leolin520 Nov 06 '14

What you described is the render loop. What I said is about how ui elements get updated information from their logical representation. To achieve this, angularjs use digest loop, it has nothing to do with Dom rendering. Wpf uses event on the other hand.