无法在NgbTooltip上读取未定义的属性'split' - @ ng-bootstrap / ng-bootstrap

时间:2017-04-17 14:03:44

标签: javascript angular tooltip ng-bootstrap

我收到一条错误消息说当从@ ng-bootstrap / ng-bootstrap悬停从NgbTooltip创建的工具提示时,无法读取未定义的属性'split'。我看到在调试时接收到的位置值是'undefined',当我检查html时,代码似乎很好,我传递的是[placement]属性的值。

控制台出错:

show

我的HTML代码:

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)

请注意工具提示按预期工作,仅在第一个悬停实例时抛出错误。有人会说代码有什么问题吗?

0 个答案:

没有答案