Javascript 无法读取属性';拆分';在NgbTooltip上未定义的值-@ng bootstrap/ng bootstrap
当悬停从@ng bootstrap/ng bootstrap使用NgbTooltip创建的工具提示时,我收到一个错误,表示无法读取未定义的属性“split”。调试时,我看到placement值被接收为“undefined”,当我检查html时,代码看起来不错,我正在传递[placement]属性的值 控制台中的错误:Javascript 无法读取属性';拆分';在NgbTooltip上未定义的值-@ng bootstrap/ng bootstrap,javascript,angular,tooltip,ng-bootstrap,Javascript,Angular,Tooltip,Ng Bootstrap,当悬停从@ng bootstrap/ng bootstrap使用NgbTooltip创建的工具提示时,我收到一个错误,表示无法读取未定义的属性“split”。调试时,我看到placement值被接收为“undefined”,当我检查html时,代码看起来不错,我正在传递[placement]属性的值 控制台中的错误: EXCEPTION: Cannot read property 'split' of undefined ErrorHandler.handleError @ error_hand
EXCEPTION: Cannot read property 'split' of undefined
ErrorHandler.handleError @ error_handler.js:54
next @ application_ref.js:348
schedulerFn @ async.js:93
SafeSubscriber.__tryOrUnsub @ Subscriber.js:236
SafeSubscriber.next @ Subscriber.js:185
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ async.js:79
NgZone.triggerError @ ng_zone.js:333
onHandleError @ ng_zone.js:294
ZoneDelegate.handleError @ zone.js:338
Zone.runTask @ zone.js:169
ZoneTask.invoke @ zone.js:420
error_handler.js:59 ORIGINAL STACKTRACE:
ErrorHandler.handleError @ error_handler.js:59
next @ application_ref.js:348
schedulerFn @ async.js:93
SafeSubscriber.__tryOrUnsub @ Subscriber.js:236
SafeSubscriber.next @ Subscriber.js:185
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ async.js:79
NgZone.triggerError @ ng_zone.js:333
onHandleError @ ng_zone.js:294
ZoneDelegate.handleError @ zone.js:338
Zone.runTask @ zone.js:169
ZoneTask.invoke @ zone.js:420
error_handler.js:60 TypeError: Cannot read property 'split' of undefined
at Positioning.positionElements (positioning.js:83)
at positionElements (positioning.js:129)
at tooltip.js:47
at SafeSubscriber.schedulerFn [as _next] (async.js:105)
at SafeSubscriber.__tryOrUnsub (Subscriber.js:236)
at SafeSubscriber.next (Subscriber.js:185)
at Subscriber._next (Subscriber.js:125)
at Subscriber.next (Subscriber.js:89)
at EventEmitter.Subject.next (Subject.js:55)
at EventEmitter.emit (async.js:79)
at ng_zone.js:244
at ZoneDelegate.invoke (zone.js:334)
at Zone.run (zone.js:126)
at NgZone.runOutsideAngular (ng_zone.js:164)
at NgZone.checkStable (ng_zone.js:244)
我的HTML代码:
<template #tipContent>{{licenorsTooltip}}</template>
<button type="button" class="licensor-btn" [placement]="bottom" [ngbTooltip]="tipContent" #t="ngbTooltip" triggers="manual"
(click)="toggleSelect()" on-mouseover='toolTipOver()' on-mouseleave="toolTipLeave()"> </button>
{{licenorstoltip}
请注意,工具提示按预期工作,并且仅在悬停的第一个实例上引发错误。有人能说代码出了什么问题吗?我通过使用
placement
而不是[placement]
placement
应该是string
或者使用placement=“bottom”
或者bottom
应该是string中的string
属性来删除错误[property]=“bottom”
我通过使用placement
而不是[placement]
删除了错误placement
应该是string
或者使用placement=“bottom”
或者bottom
应该是[property]=“bottom”
中的string
属性