mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-23 11:37:38 +08:00
fix for infinite loop in retrieveScope with jQuery + specs
- retrieveScope run into infinite loop if called on DOM tree that doesn't contain scope reference (happens only with jQuery) - added missing specs for retrieveScope function
This commit is contained in:
@@ -75,7 +75,7 @@ Template.prototype = {
|
||||
function retrieveScope(element) {
|
||||
var scope;
|
||||
element = jqLite(element);
|
||||
while (element && !(scope = element.data($$scope))) {
|
||||
while (element && element.length && !(scope = element.data($$scope))) {
|
||||
element = element.parent();
|
||||
}
|
||||
return scope;
|
||||
|
||||
Reference in New Issue
Block a user