简体   繁体   English

bs-tooltip TypeError:无法读取未定义的属性“nodeName”

[英]bs-tooltip TypeError: Cannot read property 'nodeName' of undefined

My controller looks like this 我的控制器看起来像这样

$scope.showSelectedComp = function($event, fuse_id, index) {
    var compTooltip = $tooltip($event.target, {title: 'My Title', contentTemplate:'views/compTooltip.html'});

}

And my view looks like this 我的观点看起来像这样

<p ng-mouseover="showSelectedComp($event, fuse_id, $index)">12</p>

When I hover over the element I get 当我将鼠标悬停在我得到的元素上时

TypeError: Cannot read property 'nodeName' of undefined
    at p (http://127.0.0.1:9000/bower_components/angular-strap/dist/angular-strap.min.js:9:25995)

Am I doing something wrong? 难道我做错了什么?

Change the above call to $tooltip to this: 将以上调用更改为$ tooltip:

$tooltip(angular.element($event.target), fuse_id, index)

Your problem is that the element returned in the target is not a jQuery/jQlite element hence it can't find the node name. 您的问题是目标中返回的元素不是jQuery / jQlite元素,因此无法找到节点名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 angularstrap bs-tooltip导致错误:无法读取未定义的属性“ toLowerCase” - angularstrap bs-tooltip cause error: Cannot read property 'toLowerCase' of undefined TypeError:无法读取未定义的属性“ nodeName” - TypeError: Cannot read property 'nodeName' of undefined 未捕获的类型错误:无法读取 null 的属性“nodeName” - Uncaught TypeError: Cannot read property 'nodeName' of null 无法读取SVG文件中未定义的属性“ nodeName” - Cannot read property 'nodeName' of undefined in SVG file Trumboqyg 所见即所得编辑器不适用于 Jquery.Validate 插件,“Uncaught TypeError: Cannot read property 'nodeName' of undefined” - Trumboqyg WYSIWYG editor does not work with Jquery.Validate plugin, "Uncaught TypeError: Cannot read property 'nodeName' of undefined" 无法使用select2读取jQuery验证上未定义的nodeName属性 - Cannot read property of nodeName undefined on jQuery validation with select2 VideoJS 错误 Uncaught TypeError: Cannot read property 'nodeName' of null - VideoJS error Uncaught TypeError: Cannot read property 'nodeName' of null 错误:“无法读取未定义的属性 'nodename'” 转换 html 表时 - Error : “cannot read property 'nodename' of undefined” While converting html Table TypeError:无法读取未定义的属性… - TypeError: Cannot read property … of undefined TypeError:无法读取未定义的属性 - TypeError: Cannot read property of undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM