ng在父组件中使用子组件时不在子组件中工作

时间:2018-02-02 19:13:55

标签: angular

   *parent Component*
  <div class="row">
<div class="col-xs-12">
    while accessing my child component in my parent component i am unable to 
   get the access if I use ngfor Directive
       <app-server *ngFor="let element of serverElements" 
     [elements]="element"></app-server>
  </div>
  </div>
  </div>

  *Child Component(<app-server>)*
   <button> button </button>

如果我在appComponent.html中删除ngFor指令,我的输出中会出现我的按钮。但是,当我用户ngFor指令按钮消失。请帮助我如何在我的父母中使用ngFor Directive       成分

1 个答案:

答案 0 :(得分:0)

看起来没有错误,唯一不合适的是你在父母身上有一个额外的关闭</div>标签。

相关问题