ng-bootstrap手风琴'无法读取属性' templateRef'未定义的'

时间:2017-11-21 05:12:20

标签: angular typescript ng-bootstrap

我有一个Angular 2项目,我已经工作了几个月。我已将其移至新计算机,并安装了Angular-CLI并运行它。它的工作原理除了ngb组件外,比如手风琴。他们给出了上述错误,页面崩溃了。

这是我的模板:



  <ngb-accordion #acc="ngbAccordion" activeIds="ngb-panel-0" TemplateRef="">
    <ngb-panel  *ngFor="let child of families.SelectedFamily.children; let i = index;"  TemplateRef="">
      <ng-template ngbPanelTitle  TemplateRef="">
        <span *ngIf="child.Nickname == child.userName">
          {{child.Nickname}}
        </span>
        <span *ngIf="child.Nickname != child.userName">
          {{child.Nickname}} ({{child.userName}})
        </span>
        <settings-child-settings [name]="child.Nickname" [userId]="child.UserId" [isPrimaryCarer]="child.IsPrimaryCarer"
                                 [primaryCarerConfirmed]="child.PrimaryCarerConfirmed" [primaryCarerDisputed]="child.PrimaryCarerDisputed"
                                 [userSetCarer]="child.PrimaryCarerSetByMe" [birthDay]="child.BirthDay"
                                 [birthMonth]="child.BirthMonth" [birthYear]="child.BirthYear"
        ></settings-child-settings>

        <settings-child-create style="float:right;margin-right: 20px" *ngIf="i == 0">
        </settings-child-create>
      </ng-template>
    </ngb-panel>
  </ngb-accordion>
&#13;
&#13;
&#13;

和TemplateRef =&#39;&#39;位是我为解决问题而添加的内容。我承认不熟悉TemplateRef是什么,但事实是,这段代码工作,然后它停止工作。我相信我拥有最新版本的一切。我当然运行了一个NPM更新来证明这一点。

0 个答案:

没有答案