UI Bootstrap - 缺少包含实现
UI Bootstrap - missing contains implementation
jqLite怎么可能不在元素(docs), angular bootstrap doesn't provide it neither (source), angular bootstrap doesn't depend on jQuery (package.json), nevertheless angular bootstrap is using it (line 2943)上提供方法"contains"?它来自哪里?
我会尽力解释:
$element
是 HTMLElement
浏览器 html 对象,它 包装 在 JQuery/JQlite 对象中。
当您调用 $element[0]
时,您首先得到包装的 actual HTMLElement
(在这种情况下,作者知道只有一个元素被包装) .
HTMLElement
继承自 Node
。 Node
对象具有 contains(...)
方法。
参考:
HTMLElement:https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
jqLite怎么可能不在元素(docs), angular bootstrap doesn't provide it neither (source), angular bootstrap doesn't depend on jQuery (package.json), nevertheless angular bootstrap is using it (line 2943)上提供方法"contains"?它来自哪里?
我会尽力解释:
$element
是 HTMLElement
浏览器 html 对象,它 包装 在 JQuery/JQlite 对象中。
当您调用 $element[0]
时,您首先得到包装的 actual HTMLElement
(在这种情况下,作者知道只有一个元素被包装) .
HTMLElement
继承自 Node
。 Node
对象具有 contains(...)
方法。
参考:
HTMLElement:https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement