在alpha.25上打破了ng-bootstrap标签

时间:2017-05-04 01:08:22

标签: tabs ng-bootstrap

我升级了  @ ng-bootstrap / ng-bootstrap":" ^ 1.0.0-alpha.24" 至 @ ng-bootstrap / ng-bootstrap":" ^ 1.0.0-alpha.25" 今天。

标签停止工作。得到模板错误...以下主题。

我从已保存的版本降级......开始重新开始工作了。 角度4.0.3和4.1.0

的错误相同
ERROR TypeError: Cannot read property 'templateRef' of undefined
at Object.View_NgbTabset_4.co [as updateDirectives] (NgbTabset.ngfactory.js:172)
at Object.updateDirectives (modules.js:64869)
at checkAndUpdateView (modules.js:64468)
at callViewAction (modules.js:64783)
at execEmbeddedViewsAction (modules.js:64755)
at checkAndUpdateView (modules.js:64469)
at callViewAction (modules.js:64783)
at execEmbeddedViewsAction (modules.js:64755)
at checkAndUpdateView (modules.js:64469)
at callViewAction (modules.js:64783)
at execComponentViewsAction (modules.js:64729)
at checkAndUpdateView (modules.js:64474)
at callViewAction (modules.js:64783)
at execEmbeddedViewsAction (modules.js:64755)
at checkAndUpdateView (modules.js:64469)

defaultErrorLogger @ modules.js:53534 modules.js:53534 ERROR错误:未捕获(在承诺中):TypeError:无法读取属性' templateRef'未定义的 TypeError:无法读取属性' templateRef'未定义的     at Object.View_NgbTabset_4.co [as updateDirectives](NgbTabset.ngfactory.js:172)     at Object.updateDirectives(modules.js:64869)     在checkAndUpdateView(modules.js:64468)     在callViewAction(modules.js:64783)     at execEmbeddedViewsAction(modules.js:64755)     在checkAndUpdateView(modules.js:64469)     在callViewAction(modules.js:64783)     at execEmbeddedViewsAction(modules.js:64755)     在checkAndUpdateView(modules.js:64469)     在callViewAction(modules.js:64783)     在execComponentViewsAction(modules.js:64729)     在checkAndUpdateView(modules.js:64474)     在callViewAction(modules.js:64783)     at execEmbeddedViewsAction(modules.js:64755)     在checkAndUpdateView(modules.js:64469)     at Object.View_NgbTabset_4.co [as updateDirectives](NgbTabset.ngfactory.js:172)     at Object.updateDirectives(modules.js:64869)     在checkAndUpdateView(modules.js:64468)     在callViewAction(modules.js:64783)     at execEmbeddedViewsAction(modules.js:64755)     在checkAndUpdateView(modules.js:64469)     在callViewAction(modules.js:64783)     at execEmbeddedViewsAction(modules.js:64755)     在checkAndUpdateView(modules.js:64469)     在callViewAction(modules.js:64783)     在execComponentViewsAction(modules.js:64729)     在checkAndUpdateView(modules.js:64474)     在callViewAction(modules.js:64783)     at execEmbeddedViewsAction(modules.js:64755)     在checkAndUpdateView(modules.js:64469)     at resolvePromise(modules.js:23019)[angular]     at resolvePromise(modules.js:22990)[angular]     at:3000 / packages / modules.js?hash = f354ed55dd142a450f6d0fca572238dff1e5abf2:23067:17 [angular]     at Object.onInvokeTask(modules.js:56566)[angular]     在drainMicroTaskQueue(modules.js:22900)[]     在HTMLAnchorElement.ZoneTask.invoke(modules.js:22773)[]

1 个答案:

答案 0 :(得分:3)

1.0.0-alpha.25 ng-bootstrap完全切换到Angular 4,这意味着您需要将<template>替换为<ng-template>

<ngb-tabset>
  <ngb-tab title="Simple">
    <ng-template ngbTabContent>
      <p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth
      master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh
      dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum
      iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p>
    </ng-template>
  </ngb-tab>
  <ngb-tab>
    <ng-template ngbTabTitle><b>Fancy</b> title</ng-template>
    <ng-template ngbTabContent>Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid.
      <p>Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table
      craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl
      cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia
      yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean
      shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero
      sint qui sapiente accusamus tattooed echo park.</p>
    </ng-template>
  </ngb-tab>
  <ngb-tab title="Disabled" [disabled]="true">
    <ng-template ngbTabContent>
      <p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth
      master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh
      dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum
      iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p>
    </ng-template>
  </ngb-tab>
</ngb-tabset>

这是一个工作的掠夺者:http://plnkr.co/edit/UK6LDVDduJwdS44Dmeac?p=preview