如何在现有Java Web项目中添加AngularJS 2 [英] How to add AngularJS 2 in existing Java Web project

查看:168
本文介绍了如何在现有Java Web项目中添加AngularJS 2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在.Net MVC应用程序中使用AngularJS 1.x方面有一些经验。在该项目中,我们基本上下载了所有必需的Angularjs min文件并将它们包含在项目中。我们没有使用npm或bower。它工作正常。

I have some experience using AngularJS 1.x in .Net MVC application. In that project, we basically downloaded all required Angularjs min files and included them in project. We did not use npm or bower. It worked fine.

现在我的下一个项目是在Java Web应用程序上。这是一个使用普通servlet / jsp的现有应用程序。我想在我正在开发的新页面上使用Angularjs 2。但是我无法在如何将Angularjs包含在这个现有项目中取得进展。

Now my next project is on Java Web application. This is an existing application with plain servlet/jsp. I want to use Angularjs 2 on new pages that I'm developing. But I'm not able to make progress on how to include Angularjs in this existing project.

Angular团队建议使用Typescript和npm / gulp。但我想坚持使用javascript,而不是在现有项目中引入TypeScript的复杂性。我期待下载角度min文件并包含在我的JSP中并开始使用。显然我甚至找不到链接做下载min文件。 New Angular 网站甚至没有链接下载它们。我还查找了 angular github 但找不到min文件。

Angular team recommends to use Typescript along with npm/gulp. But I want to stick to javascript and not introduce complications with TypeScript in existing project. I was expecting to download angular min files and include in my JSP and get going. Apparently I cannot even find link do download min files. New Angular website doesn't even have link to download them. I also looked up angular github but couldn't find min files.

如果有人能指导我正确的方向,我将不胜感激。在这一点上,我想坚持1.x而不是2.0。谢谢。

I would appreciate if someone can guide me in right direction. At this point, I'm thinking to stick to 1.x instead of 2.0. Thank you.

推荐答案

哇,这太烦人了。

你可以试试使用NPM创建测试项目,添加所需的依赖项,然后构建项目。从那里,你可以复制粘贴你需要的javascript文件。

You could try creating a test project using NPM, add the dependencies you need, and then build the project. From there, you could copy paste out the javascript files you need.

希望有所帮助。

这篇关于如何在现有Java Web项目中添加AngularJS 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆