I am confused about angularjs manipulation.
How come:
angular.element("#elementID").is(':visible') ; // works
angular.element("#elementID").slideUp() ; // works
angular.element("#elementID").style.opacity = 1 ; // **doesn't work**
angular.element("#elementID")[0].style.opacity = 1 ; // works
angular.element("#elementID").css('opacity' : 1) ; // **doesn't work**
I have a Cordova/Ionic app, jquery is installed. I feel the .css(field : value) should be working.
The various methods keep tripping me up. Can someone shed some light on this for me?
angular.elementreturn ajQueryobject prototype, or is it an Angular-specific flavor? Nevermind, I answered my own question, it does. Please make sure Angular can see jQuery, because "jqLite is a tiny, API-compatible subset of jQuery". This means that it is not a fully-featured replacement for jQuery. I suspect jQuery is not actually available to your Angular application.angular.element("#elementID").get(0).style.opacity = 1This is because jQuery does not have access to thestyleproperty of the raw element.get()isn't a function of angluarJS. According to the documentation docs.angularjs.org/api/ng/function/angular.element -css()should be working...but alsois, `slideUp()' work but are not defined here either. Makes me wonder if Ionic extended it.$.fn.getis a function injQuery. It unwraps the nativeElement. The actual DOM element has astyleproperty, not the jQuery object.