0
我需要知道,如果一個元素id="Tags"
是目前我角的控制文件中....Angular的jQueryLite如何通過id查找元素?
所以我做檢查(即時窗口調試結果):
?angular.element($document).find("#Tags").length
0
?$("#Tags").length
1
?angular.element($document.querySelector('#Tags'))
VM1119:1 Uncaught TypeError: $document.querySelector is not a function
只是想知道,如何讓jQueryLite通過ID查找元素...
隨着AngularJS框架,一個通常使用的[屬性指令(HTTPS://docs.angularjs .org/guide/directive)。該元素在postLink函數中作爲'element [0]'或者指令控制器在'$ element [0]'中可用。 – georgeawg