Sub component template not rendered

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 00:02:43

问题


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.

来源:https://stackoverflow.com/questions/49318772/sub-component-template-not-rendered

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!