2017-05-04 52 views
0

我从 升级破@ NG-引导/ NG的自举 “: ”^ 1.0.0-alpha.24“ 到 @ NG-引导/ NG的自举”:“^1.0.0-alpha.25“ 今天。NG-引导标签上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错误错误:未捕获的(在承诺):类型错误:无法读取属性 'templateRef' 的未定义 类型错误:未定义 在Object.View_NgbTabset_4.co无法读取属性 'templateRef'[如updateDirectives](NgbTabset.ngfactory.js:172) 在Object.updateDirectives(modules.js:64869) 在checkAndUpdateView(模块。 js:64468) at callViewAction(modules.js:64783) at execEmbeddedViewsAction(modules.js:64755) 在checkAndUpdateView(modules.js:64469) 在callViewAction(modules.js:64783) 在execEmbeddedViewsAction(modules.js:64755) 在checkAndUpdateView(modules.js:64469) 在callViewAction(modules.js:64783) 在execComponentViewsAction(modules.js:64729) 在checkAndUpdateView(modules.js:64474) 在callViewAction(modules.js:64783) 在execEmbeddedViewsAction(modules.js:64755) 在checkAndUpdateView(modules.js:64469) (module.js:64468)在Object.updateDirectives(modules.js:64869) 处的Object.View_NgbTabset_4.co [as updateDirectives](NgbTabset.ngfactory.js:172)在callViewAction(modules.js:64783) 在execEmbeddedViewsAction(modules.js:64755) 在checkAndUpdateView(modules.js:64469) 在callViewAction(modules.js:64783) 在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 resolveEmbeddedViewsAction(modules.js:64755) at checkAndUpdateView(modules.js:64469) at resolvePromise(modules.js:23019)[angular] at resolv ePromise(modules.js:22990)[角]在 :3000 /包/ modules.js散列= f354ed55dd142a450f6d0fca572238dff1e5abf2:23067:17 [角]在 Object.onInvokeTask(modules.js:56566)[角]在 drainMicroTaskQueue (modules.js:22900)[] 在HTMLAnchorElement.ZoneTask.invoke(modules.js:22773)[]

回答

3

1.0.0-alpha.25ng-bootstrap完全切换到角4,这意味着需要与<ng-template>更换<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> 

这里是一个工作plunker:http://plnkr.co/edit/UK6LDVDduJwdS44Dmeac?p=preview

+0

谢谢。那样做了。 – user3411890

+0

@ user3411890如果它适合您,请接受答案。 –