一个主要应用程序中的角多个项目

时间:2019-10-22 07:11:12

标签: angular

这是我需要的项目:

您有一个包含x个子应用程序的主程序。

应该通过URL调用主程序(/ example1 /....->子程序1,/ example2 /....->加载子程序2 |全部带有自己的路由器出口)

但是,子例程应该是独立的,并使用其自己的router-outlet加载其自己的app.component.html。

我找到了一个项目:

https://medium.com/disney-streaming/combining-multiple-angular-applications-into-a-single-one-e87d530d6527

几乎所有功能都可以按照我的想象进行,但是子应用程序的组件直接加载到主路由器出口中(未使用各个子应用程序的app.component.html)。现在的问题是,是否可以加载应用程序的app.component.html而不是实际的组件。

当前树结构

D:.
|   .editorconfig
|   .gitignore
|   .travis.yml
|   angular.json
|   dir
|   package-lock.json
|   package.json
|   README.md
|   tsconfig.json
|   tslint.json
|   
+---e2e
|   |   protractor.conf.js
|   |   tsconfig.e2e.json
|   |   
|   \---src
|           app.e2e-spec.ts
|           app.po.ts
|              
+---projects
|   +---sub-app1
|   |   |   browserslist
|   |   |   karma.conf.js
|   |   |   tsconfig.app.json
|   |   |   tsconfig.spec.json
|   |   |   tslint.json
|   |   |   
|   |   \---src
|   |       |   favicon.ico
|   |       |   index.html
|   |       |   main.ts
|   |       |   polyfills.ts
|   |       |   styles.css
|   |       |   test.ts
|   |       |   
|   |       +---app
|   |       |   |   app-routing.module.ts
|   |       |   |   app.component.css
|   |       |   |   app.component.html
|   |       |   |   app.component.spec.ts
|   |       |   |   app.component.ts
|   |       |   |   app.module.ts
|   |       |   |   
|   |       |   +---nav
|   |       |   |       nav.component.css
|   |       |   |       nav.component.html
|   |       |   |       nav.component.spec.ts
|   |       |   |       nav.component.ts
|   |       |   |       
|   |       |   +---view1
|   |       |   |       view1.component.css
|   |       |   |       view1.component.html
|   |       |   |       view1.component.spec.ts
|   |       |   |       view1.component.ts
|   |       |   |       
|   |       |   \---view2
|   |       |           view2.component.css
|   |       |           view2.component.html
|   |       |           view2.component.spec.ts
|   |       |           view2.component.ts
|   |       |           
|   |       +---assets
|   |       |       .gitkeep
|   |       |       
|   |       \---environments
|   |               environment.prod.ts
|   |               environment.ts
|   |               
|   \---sub-app2
|       |   browserslist
|       |   karma.conf.js
|       |   tsconfig.app.json
|       |   tsconfig.spec.json
|       |   tslint.json
|       |   
|       \---src
|           |   favicon.ico
|           |   index.html
|           |   main.ts
|           |   polyfills.ts
|           |   styles.css
|           |   test.ts
|           |   
|           +---app
|           |   |   app-routing.module.ts
|           |   |   app.component.css
|           |   |   app.component.html
|           |   |   app.component.spec.ts
|           |   |   app.component.ts
|           |   |   app.module.ts
|           |   |   
|           |   +---nav
|           |   |       nav.component.css
|           |   |       nav.component.html
|           |   |       nav.component.spec.ts
|           |   |       nav.component.ts
|           |   |       
|           |   +---view1
|           |   |       view1.component.css
|           |   |       view1.component.html
|           |   |       view1.component.spec.ts
|           |   |       view1.component.ts
|           |   |       
|           |   \---view2
|           |           view2.component.css
|           |           view2.component.html
|           |           view2.component.spec.ts
|           |           view2.component.ts
|           |           
|           +---assets
|           |       .gitkeep
|           |       
|           \---environments
|                   environment.prod.ts
|                   environment.ts
|                   
\---src
    |   browserslist
    |   favicon.ico
    |   index.html
    |   karma.conf.js
    |   main.ts
    |   polyfills.ts
    |   styles.scss
    |   test.ts
    |   tsconfig.app.json
    |   tsconfig.spec.json
    |   tslint.json
    |   
    +---app
    |   |   app-routing.module.ts
    |   |   app.component.html
    |   |   app.component.scss
    |   |   app.component.spec.ts
    |   |   app.component.ts
    |   |   app.module.ts
    |   |   
    |   \---nav
    |           nav.component.html
    |           nav.component.scss
    |           nav.component.spec.ts
    |           nav.component.ts
    |           
    +---assets
    |       .gitkeep
    |       
    \---environments
            environment.prod.ts
            environment.ts

0 个答案:

没有答案