简体   繁体   English

如何将Angular 4与Vaadin框架集成

[英]How to integrate Angular 4 with Vaadin framework

I want to use Angular 4 with a Vaadin 8 Java application in order to push a considerable amount of UI logic to client-side, reduce server round trips, make the client-side functionality available during slow network connections, and make use of the best features of both frameworks. 我想将Angular 4与Vaadin 8 Java应用程序结合使用,以便将大量UI逻辑推送到客户端,减少服务器往返,在缓慢的网络连接期间使客户端功能可用,并利用最佳功能。两个框架的功能。 I went through the Vaangular project mentioned on Vaadin and AngularJS - happy together article, but it won't work for my requirement since I use Angular 4. 我经历了Vaadin和AngularJS上提到的Vaangular项目 -在一起很开心 ,但是由于我使用Angular 4,因此无法满足我的要求。

I tried workarounds like writing JS wrappers and inserting Angular code inside Custom Layouts, but those efforts were not successful. 我尝试了一些变通方法,例如编写JS包装器和在“自定义布局”中插入Angular代码,但是这些努力都没有成功。 What kind of approach should I take? 我应该采取哪种方法? Can I have an example if available? 我可以举个例子吗?

Integrating Angular, React or any other client side framework/library with Vaadin framework does not seem to be a good idea because none of these frameworks were meant to work like that. 将Angular,React或任何其他客户端框架/库与Vaadin框架集成似乎不是一个好主意,因为这些框架都不打算像那样工作。

After communicating the practical use cases in favor of doing more client side logic and managing slow network connections, Vaadin team responded very positively explaining their plans for Vaadin 10 (ie Vaadin Flow), the new face of Vaadin which gives more power for client side work. 在交流了实际用例以支持执行更多客户端逻辑并管理缓慢的网络连接后,Vaadin团队做出了非常积极的回应,解释了他们对Vaadin 10(即Vaadin Flow)的计划,这是Vaadin的新面貌,为客户端工作提供了更多功能。

As of now, Vaadin team has announced the Developer Preview of Vaadin Flow. 截至目前,Vaadin团队已宣布Vaadin Flow开发人员预览版。 With Flow, the traditional Vaadin developers get the privilege to use custom client side elements and logic without much pain. 借助Flow,传统的Vaadin开发人员可以毫不费力地使用自定义客户端元素和逻辑。

Flow provides the following methods of interacting with the DOM in the user's web browser: Flow提供了以下与用户的Web浏览器中的DOM交互的方法:

  • HTML-based templates that are bound to server-side Model data. 绑定到服务器端模型数据的基于HTML的模板。
  • A server-side representation of the client-side DOM tree. 客户端DOM树的服务器端表示。
  • A type-safe Java RPC API for interacting with JavaScript in the browser. 类型安全的Java RPC API,用于在浏览器中与JavaScript进行交互。

These mechanisms are intended to be encapsulated into reusable components with a high-level Java API. 这些机制旨在通过高级Java API封装到可重用的组件中。

Please do have a look into these great resources for more information: 请查看这些重要资源以获取更多信息:

  1. Vaadin Flow - the next piece of Vaadin 10 is now in developer preview Vaadin Flow-下一个Vaadin 10现已在开发人员预览版中
  2. Vaadin Flow Official Documentation Vaadin Flow官方文档
  3. Vaadin Elements in Vaadin 10 Vaadin元素在Vaadin 10中
  4. Vaadin Framework 8 roadmap 2017 and beyond Vaadin Framework 8路线图2017年及以后

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM