Sub component template not rendered

2019-08-21 03:11发布

问题:

I created a brand new project with jhipster using angular, internationalization and maven. The project compiles and runs without any problem. Than I created a new angular component with:

ng generate component my-new-component

I included that component into src/main/webapp/app/layouts/main/main.component.html

<jhi-page-ribbon></jhi-page-ribbon>
<div>
<router-outlet name="navbar"></router-outlet>
</div>
<div class="container-fluid">
<div class="card jh-card">
    <router-outlet></router-outlet>
    <router-outlet name="popup"></router-outlet>
</div>
<jhi-footer></jhi-footer>
<jhi-my-new-component></jhi-my-new-component>
</div>

and also into src/main/webapp/app/home/home.component.html

<div class="row">
<div class="col-md-3">
    <span class="hipster img-fluid rounded"></span>
</div>
<div class="col-md-9">

         <h1 class="display-4" jhiTranslate="home.title">Welcome, Java Hipster!    </h1>
      <jhi-my-new-component></jhi-my-new-component>
    <p class="lead" jhiTranslate="home.subtitle">This is your homepage</p>

The component into main.component.html is correctly rendered. But on the second case, home.component.html, the component tag is rendered, but component's template is not rendered.

Any suggestion will be really appreciated.

Some info:

Using JHipster version installed locally in current project's node_modules 4.14.1

our global Angular CLI version (1.7.3) is greater than your local version (1.6.6). The local Angular CLI version is used.