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

Angular 一个主应用程序中的多个项目,angular,Angular,这是我在项目中需要的: 您有一个包含x个子应用程序的主程序 主程序应该由URL调用(/example1/…->subprogram 1,/example2/…->load subprogram 2 |都有自己的路由器出口) 但是,子例程应该是独立的,并使用自己的app.component.html和路由器插座加载 我发现了一个项目: 几乎一切都如我想象的那样工作,但子应用程序的组件直接加载到主路由器出口(不使用相应子应用程序的app.component.html)。现在的问题是,是否可以加载应

这是我在项目中需要的:

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

主程序应该由URL调用(/example1/…->subprogram 1,/example2/…->load subprogram 2 |都有自己的路由器出口)

但是,子例程应该是独立的,并使用自己的app.component.html和路由器插座加载

我发现了一个项目:

几乎一切都如我想象的那样工作,但子应用程序的组件直接加载到主路由器出口(不使用相应子应用程序的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

你好你找到解决办法了吗?