Angular和Flux可以一起工作吗?

[英]Angular and Flux can they work together?


Flux is a unidirectional data flow originated in the React team, it hold many benefits (Undo/Redo, Easy to test, one State to the app, and more) and it would be nice to combine it with AngularJs.

Flux是一个源自React团队的单向数据流,它具有许多优点(撤销/重做,易于测试,一个状态到应用程序,等等),将它与AngularJs结合起来会很不错。

Victor Savkin wrote a blog post on how to implement it using AngularJs, but he broke a basic concept of Flux by changing the store instead of re-creating a new instance of it. Another thing that bothers me is that Angular is using ng-model and data binding, using Flux means that we should not use these anymore...

Victor Savkin撰写了一篇关于如何使用AngularJs实现它的博客文章,但他通过更改商店而不是重新创建它的新实例来打破Flux的基本概念。困扰我的另一件事是Angular正在使用ng-model和数据绑定,使用Flux意味着我们不应再使用它们......

Thinking about all these issues, sounds like Angular and Flux paradigmas are colliding.

考虑到所有这些问题,听起来像Angular和Flux范例正在发生碰撞。

Anyone ever really creating a working Angular in Flux that works (As expected)?

任何人都真正在Flux中创建一个有效的Angular(正如预期的那样)?

1 个解决方案

#1


0  

With the Flux folk recommending Redux instead, whether the latter and Angular can work together is perhaps a better question. On that, they certainly can be and I recently wrote a blog post http://simonh1000.github.io/2015/10/angular2-one-way-data-binding/. I'm not sure how efficient it is as Redux complement React whereas it substitutes for some of Angular's model handling.

随着Flux民众推荐Redux,后者和Angular能否协同工作也许是一个更好的问题。在那,他们当然可以,我最近写了一篇博客文章http://simonh1000.github.io/2015/10/angular2-one-way-data-binding/。我不确定它是多么有效,因为Redux补充了React,而它取代了Angular的一些模型处理。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.silva-art.net/blog/2015/10/29/35b36e7fb1ec77bda98007884c501086.html



 
© 2014-2019 ITdaan.com 粤ICP备14056181号