2017-05-04 30 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如果它適合您,請接受答案。 –