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
を不思議idによって要素を見つけるjQueryLite ...
に結果を変えることができ、1は一般的に[属性ディレクティブ]を使用しています(HTTPS://docs.angularjs .org/guide/directive)を参照してください。この要素はpostLink関数で 'element [0]'または指示子コントローラとして '$ element [0]'として利用できます。 – georgeawg