如何将 Angular2 与 Java 集成
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37898055/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to integrate Angular2 with Java
提问by Kishore
I am working on dropwizard and angular2. both are working fine in different server. I want to integrate angular2 with java so that they can work on single server. I have tried tomitribe/weeklerbut when I did, mvn clean package it gives error. Any one have tried angular2 with java.
我正在研究 dropwizard 和 angular2。两者都在不同的服务器上工作正常。我想将 angular2 与 java 集成,以便它们可以在单个服务器上工作。我试过tomitribe/weekler但是当我这样做时, mvn clean package 它给出了错误。任何人都曾用 java 尝试过 angular2。
回答by Marcin Sza?omski
Here is another example of Java and Angular 2 integration: http://lteconsulting.fr/angular2boot/.
这是 Java 和 Angular 2 集成的另一个示例:http: //lteconsulting.fr/angular2boot/。
Demo app here: https://github.com/ltearno/angular2-gwt.
演示应用程序在这里:https: //github.com/ltearno/angular2-gwt。
The way it's different from JHipster is that you have also Angular2 frontend in Java. As you see this is also Angular 2 dependent.
它与 JHipster 的不同之处在于您还有 Java 中的 Angular2 前端。如您所见,这也依赖于 Angular 2。
If about the server side... You have by default Spring Boot integration. But you can of course use it with any Java backend, like JavaEE with JAX-RS Web services or whatever else.
如果关于服务器端......默认情况下您有 Spring Boot 集成。但是您当然可以将它与任何 Java 后端一起使用,例如带有 JAX-RS Web 服务的 JavaEE 或其他任何东西。
回答by Kyle Anderson
I'll give you some examples of Java + Angular but they use the Spring Framework. Should be easy enough to port to Dropwizard.
我会给你一些 Java + Angular 的例子,但它们使用 Spring 框架。应该很容易移植到 Dropwizard。