Below logic does not work:
 var table;
    if(document.getElementById('datatable').previousElementSibling.innerHTML
== this.label){
      table = document.getElementById("datatable") as HTMLTableElement
    }

On Thu, 16 Apr 2020 at 10:25, Rahul Kumar <rajput4u4...@gmail.com> wrote:

> Thanks Sander. I am trying while passing some data as input to table.
> So currently i wanted to know how to select that element using query
> selector or what.
> I have caption of each table which is unique and i have access to that
> caption in .ts file as well.
> Below line gives me actual caption of table.
> Now i will check in code
> if
> (document.getElementById('datatable1').previousElementSibling.innerHTML== <
> caption which is there  in .ts file){
> // select that element
> }
> In short , i want to write a query which can select a table out of all,
> with given caption , can you please help me to write this small piece of
> code, ?
>
> document.getElementById('datatable').previousElementSibling.innerHTML
>
> On Thu, 16 Apr 2020 at 10:20, Sander Elias <sanderel...@gmail.com> wrote:
>
>> Let me put it otherwise:
>> his code:
>>
>> document.querySelectorAll('table').forEach((elm,i) =>  elm.setAttribute(
>> 'id','imnumber'+i)
>>
>> will set a unique id on every table. I don't think that will solve your
>> issue. You probably need to set it to something that conveys's meaning to
>> the table. I think you need to split out your tables into components of
>> their own that contain the functionality you are now trying to bolt on.
>>
>> Regards
>> Sander
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Angular and AngularJS discussion" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to angular+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/angular/1f4dd49d-10fa-499b-9e99-c164e43904ad%40googlegroups.com
>> <https://groups.google.com/d/msgid/angular/1f4dd49d-10fa-499b-9e99-c164e43904ad%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/CAGH8rExCYsLEoWJAF_%2B%3DXY-e97vi-eDSKmD2jiGU1iKDO%3DK%2BMA%40mail.gmail.com.

Reply via email to