I have a form in a angular view. And in the button on the form, I've added
an event to send request to the server using $http. Before sending the
request to the server, I need to validate the form using jQuery Validate.
To validate the form, I need the dom reference of the form in the
controller. I already have jQuery in my application. So can get the
reference of the form using
$(selecter) or angular.element($(selecter))
But in both cases, it'll search the full document to get the reference of
the element. Instead of that I need to search the element within the
context of the view, which will increase the performance.
I've seen the use of $element in angular. But later I've seen that the use
of $element is not recommended and it may be depreciated in the new version
of angular. And when I'm trying to get $element within the controller, I'm
getting an error. So I guess it's depreciated already.
So what is the best way to get dom element in context of view from the
controller?
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.