如何在JSP页面中包含angular2/4组件?

问题描述:

我想在JSP页面中添加角度分量,可能的方法是什么?

I want to add angular component into JSP page, what are the possible ways ?

要描述更多:

我在JSP中有一个应用程序动态Web应用程序,而我创建的另一个应用程序是一个进行身份验证的有角度的组件. 除了对象,嵌入式或iframe,是否可以在JSP Web应用程序中使用此组件?

I have one application dynamic web application in JSP and another I created is an angular component which does some authentication. Is there way to use this component in JSP web application, apart from object,embedd or iframe ?

我能够通过使用以下命令构建角度组件来实现此目的的另一种方法:

Another way I was able to do it, by building the angular component with command:

ng build 

这将生成JavaScript文件,该文件将在您的angular项目的dist文件夹中创建.

This will generate JavaScript files will be created in dist folder of your angular project.

然后仅将dist文件夹中的文件包含到您的JSP应用程序中,并直接使用angular组件.

Then just include the files from the dist folder into your JSP application and use angular component directly.