angular.element vs document.getElementById or jQuery selector with spin (busy) control

后端 未结 10 2433
感动是毒
感动是毒 2020-11-28 02:18

I\'m using the \"Angularised\" version of the Spin control, as documented here: http://blog.xvitcoder.com/adding-a-weel-progress-indicator-to-your-angularjs-application/

10条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-28 02:42

    You should inject $document in your controller, and use it instead of original document object.

    var myElement = angular.element($document[0].querySelector('#MyID'))
    

    If you don't need the jquery style element wrap, $document[0].querySelector('#MyID') will give you the DOM object.

提交回复
热议问题