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/
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.
I don't think it's the right way to use angular. If a framework method doesnt exist, don't create it! This means the framework (here angular) doesnt work this way.
With angular you should not manipulate DOM like this (the jquery way), but use angular helper such as
<div ng-show="isLoading" class="loader"></div>
Or create your own directive (your own DOM component) in order to have full control on it.
BTW, you can see here http://caniuse.com/#search=queryselector querySelector is well supported and so can be use safely.
You should read the angular element docs if you haven't yet, so you can understand what is supported by jqLite and what not -jqlite is a subset of jquery built into angular.
Those selectors won't work with jqLite alone, since selectors by id are not supported.
var target = angular.element('#appBusyIndicator');
var target = angular.element('appBusyIndicator');
So, either :
Edit: Note that jQuery should be loaded before angularJS in order to take precedence over jqLite:
Real jQuery always takes precedence over jqLite, provided it was loaded before DOMContentLoaded event fired.
Edit2: I missed the second part of the question before:
The issue with <input type="number">
, I think it is not an angular issue, it is the intended behaviour of the native html5 number element.
It won't return a non-numeric value even if you try to retrieve it with jquery's .val()
or with the raw .value
attribute.
var target = document.getElementById('appBusyIndicator');
is equal to
var target = $document[0].getElementById('appBusyIndicator');