Join the Stack Overflow Community
Stack Overflow is a community of 6.6 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

I have a table with 5 columns and this table data is hard-coded, that is it doesn't use ng-repeat directive like

<tr ng-repeat="obj in collection">
<td>{{obj.name}}</td>
<td>{{obj.class}}</td>
</tr>.
one of the columns contain a checkbox if the user selects a checkbox of a row, i need to extract the values of the other four columns of that row.i read that for DOM manipulation we have to create custom directive, my doubt is what should go inside the directive can i use jquery to traverse the DOM and get the values of the other four columns or is there a way to do it without using jQuery?

share|improve this question
    
Anything that jQuery can do, can be done in plain JS and it will work much faster in most cases. – Shomz Aug 24 '14 at 21:11
    
@Shomz sorry for not being clear in the question. i am a newbie to angularjs, i read one should try to avoid writing DOM related code either through jquery or plain JS when using angularjs, so i need to know how to write my directive implementation, is writing explicit DOM traversing code is the only way or is there any other solution for this problem. – ven Aug 24 '14 at 21:26
    
I understand, I just meant there's no need to drag jQuery into it. And yes, you are correct about avoiding the DOM code, but sometimes you just have to do it. I'd definitely go with the plain JS here, perhaps creating a service that spits an object created from the DOM structure you send it. Not sure if there's a "more Angular" way than that. :) – Shomz Aug 24 '14 at 23:22
    
thanks for your suggestion, i will go with creating a service for getting the object from DOM structure. – ven Aug 25 '14 at 1:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.