小编ast*_*eet的帖子

带有Typeahead的AngularUI和ngTable中的工具提示,其自定义标题长度未在scope.isOpen中定义

我在带有自定义标题的ng表中使用Typeahead和Tooltip.这似乎在功能上有效,如果你看看这个plunker,你从来没有注意到一个问题.但是,当您运行代码时,它会生成很多错误,可以在控制台中看到.每当我将鼠标悬停在其中一行上时,或者当我从Typeahead中选择一个值时,就会在加载时生成错误.有谁知道如何解决这个问题?我一直在研究它几天,我还没有找到解决方案.

这是错误.

TypeError: Cannot read property 'length' of undefined
at Scope.scope.isOpen (http://localhost:61814/app/Scripts/ui-bootstrap-tpls-0.11.0.js:3756:31)
at $parseFunctionCall (http://localhost:61814/app/Scripts/angular.js:11351:18)
at Scope.$eval (http://localhost:61814/app/Scripts/angular.js:13202:28)
at Object.watchExpression (<anonymous>:763:37)
at Scope.$digest (http://localhost:61814/app/Scripts/angular.js:13032:40)
at Scope.$delegate.__proto__.$digest (<anonymous>:844:31)
at Scope.$apply (http://localhost:61814/app/Scripts/angular.js:13306:24)
at Scope.$delegate.__proto__.$apply (<anonymous>:855:30)
at done (http://localhost:61814/app/Scripts/angular.js:8797:47)
at completeRequest (http://localhost:61814/app/Scripts/angular.js:9012:7) 
Run Code Online (Sandbox Code Playgroud)

这是我的控制器代码

var app = angular.module('plunker', ['ui.bootstrap','ngTable' ]);

app.controller('MainCtrl', function($scope, $filter, ngTableParams) {
$scope.name = 'World';


$scope.testFilterText = "";

$scope.data = {};
$scope.data.selected = "";

$scope.testData = [{Name:"Han Solo",Role:"Smuggler"},{Name:"Luke Skywalker",Role:"Moisture Farmer"},{Name:"Princess Leia",Role:"Princess"},{Name:"Obie Wan Kenobi",Role:"Jedi Master"},{Name:"Chewbacca",Role:"Smuggler"},{Name:"Boba Fett",Role:"Bounty Hunter"},{Name:"Darth Vader",Role:"Sith Lord"},{Name:"Wedge Antilles",Role:"Pilot"},{Name:"C3PO",Role:"Protocol Droid"},{Name:"R2D2",Role:"Astromech Droid"},{Name:"Jabba …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs angular-ui angularjs-ng-repeat ngtable

5
推荐指数
1
解决办法
1171
查看次数