I'm trying to set up a Bootstrap tab strip with Angular 2. I have the tabs rendering in an ngFor
but I'm getting template errors when I try to put the #
infront of the href
expression. So this template compiles but isn't what I want:
<ul class="nav nav-tabs" role="tablist">
<li *ngFor="let aType of resourceTypes; let i = index"
[ngClass]="{'active': i == 0}"
role="presentation">
<a [attr.href]="aType.Name"
[attr.aria-controls]="aType.Name"
role="tab"
data-toggle="tab">
{{aType.Name}}
</a>
</li>
</ul>
What I want to do is [attr.href]="#aType.Name"
but that blows up. What is the correct syntax to prepend the #
in front of the expression in the attribute directive?