因此,我的客户希望我将其AngularJS页面迁移到最新的Angular 8框架。 但是他还想在当前的AngularJS应用程序中添加一些功能。 工作流程如下: 1.将AngularJS迁移到Angular 8 2.当旧代码中包含新内容时,请继续维护旧的Angular JS应用。
该应用具有静态标题导航。所以我的想法是在Angular 8中构建标头,然后通过iframe将旧的Angular JS应用放到Angular 8的根目录中。 因此,当用户单击Angular 8应用程序中的导航时,他将路由到正确的Angular JS应用程序,该应用程序将在Angular 8应用程序的iframe中呈现。
因此,其背后的想法是逐页迁移页面,但如果需要,仍可以维护旧的AngularJS应用。
这可能吗?
我希望有人能帮助我。
最诚挚的问候
答案 0 :(得分:1)
起初,我建议您使用This migration guide
第二,我在一个同时使用了Angular Js和angular8的应用程序上工作,我唯一遇到的问题是roots,我无法在angular中进行usr路由。
我该怎么做?
我通过<script></script>
在同一个jsp中调用了角度js和转置的角度8个文件
这是我的jsp的一个示例,其中有一个名为pointe的angular 8应用程序,一个名为employee
<%@ include file="init.jsp" %>
<link rel="stylesheet" href="/angulars/pointe/styles.css"/>
<app-root></app-root>
<script src="/angulars/pointe/runtime-es2015.js" type="module"></script>
<script src="/angulars/pointe/runtime-es5.js" nomodule defer></script>
<script src="/angulars/pointe/polyfills-es5.js" nomodule defer></script>
<script src="/angulars/pointe/polyfills-es2015.js" type="module"></script>
<script src="/angulars/pointe/scripts.js" defer></script>
<script src="/angulars/pointe/main-es2015.js" type="module"></script>
<script src="/angulars/pointe/main-es5.js" nomodule defer></script>
<script src="/angulars/employee/js/angular.js"></script>
<script src="/angulars/employee/js/app.js"></script>
我认为,如果您将脚本加载到iframe中,它也可以使用, 但是您必须以任何方式将所有这些代码包装在容器中。
最后我真的不建议您这样做,因为我在用角度js和角度8加载的库中遇到了很多麻烦