I try to use NgTabset but i get this error TypeError: Cannot read property 'templateRef' of undefined .When i replace the ng-template with the template tag everything works fine .What am i doing wrong? Here is the code:
<ngb-tabset>
<ngb-tab>
<ng-template ngbTabTitle>
Tab1
</ng-template>
<ng-template ngbTabContent>
Here is tab 1
</ng-template>
</ngb-tab>
</ngb-tabset>
The comment by David Aguirre suggested this is a dependency issue, but it seems to due at least in part to the ng-bootstrap version.
I had this same problem and noticed that my version of ng-bootstrap was 1.0.0-alpha.24, but in the example at https://ng-bootstrap.github.io/app/components/tabset/demos/basic/plnkr.html the line in config.js was
'@ng-bootstrap/ng-bootstrap': 'npm:@ng-bootstrap/[email protected]/bundles/ng-bootstrap.js'
When I lowered that version number to 1.0.0-alpha.24 I got the bunch of error messages below.
Making the change up to 1.0.0-alpha.28 worked in the version of our code on the Web, but in the code in the VCCode development environment I found that just changing
<template>
to<ng-template>
andin package.json to
was not enough to fix the problem, but creating a new CLI instance fixed the problem, so there must be some other dependency that I didn't find.
The warning at https://ng-bootstrap.github.io/app/components/tabset/demos/basic/plnkr.html with 1.0.0-alpha.24 was:
This was misleading since the code uses the
<ng-template>
, not the<template>
element as claimed in the warnings.The first lines of the error messages were:
Hopefully when other people get these messages they will find this thread.
It would be helpful if the warning and error message were not so misleading and unclear.