1

I'm using Angular 2 and ng-bootstrap. I've got an [ngSwitch] with different tooltips defined in the content based on the case.

When the [ngSwitch] variable changes, the tooltip throws an exception: this._unregisterListenersFn is not a function at NgbTooltip.ngOnDestroy.

I'm not sure if this could be a glitch with the ng-bootstrap library or if I'm doing something wrong.

Here is the offending code:

<div [ngSwitch]='jobStatusItem.type'>
    <ul>
        <li *ngFor='let item of filteredItems()'>
            <span *ngSwitchCase='"job"'>
                <template #tooltipContent>Details</template>
                <span (click)='loadItem(item)' [ngbTooltip]='tooltipContent'>
                    <img src='...' />
                </span>
            </span>
        </li>
    </ul>
</div>

Here is the error message: enter image description here

I'm able to change the jobStatusItem.type once without problems, but the second time it throws the error.

HaveSpacesuit
  • 3,572
  • 6
  • 40
  • 59

0 Answers0