Currently in my js code I'm using the following snippet to select an html element and do stuff. Is there a better way in Angular.js to do this?
document.getElementById("someElement");
angular.element('#someElement') //to select by id
angular.element('.someElement') //to select by class
Angular has angular.element which might be useful for this. https://docs.angularjs.org/api/ng/function/angular.element
AngularJS has a trimmed down version of jQuery ( jQLight ). That makes selection easier. Is it what it's best used for; selecting elements.
$('#someElement')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.