0

I have a question aboout angular 2 and ts. Is iT possible to display content of table cell only when the cell width will be resized ? And hide when back to normal width ?

<td class='month-inner'*ngFor="let dates of monthDate; #idx = first" [style.padding-left]="idx === true ? '54px' : ''" >
  <tr style='background-color:#3670af;' >
      <td colspan="3" >{{dates.yearMonth}}</td>
    </tr>
    <tr>                                                                                                                            
      <th>Ov</th>
      <th>Ov_min</th>
      <th>Pic_Min</th>
  </tr>

I want to everything inside "< td class='month-inner' >"shows when width grow. I still lerning angular 2 and ts and dont have any ide how to do it

Przemysław Zamorski
  • 741
  • 2
  • 14
  • 31

1 Answers1

0

I think there is 2 part answer to this.

  1. Is there a DOM event that is thrown at the cell width resize? So here is the list of all possible DOM events. https://developer.mozilla.org/en-US/docs/Web/Events There is resize event but the resize is on document view resize and not specifically for the cell.
  2. Given there is a DOM event how to bind it to a function in Angular 2 so that you can take action? This can be achieved as shown here https://angular.io/docs/ts/latest/guide/user-input.html As you can see in this example they have provided a way to bind an event to function
lazy
  • 531
  • 2
  • 4
  • Hmm a render two other components on is header second is content and its look like this. The content have a button with function onclick. After click shows cell detaills and table cell extends horizontal. Then in header component column extends too. And i want to apper something inside this header cell after extends. – Przemysław Zamorski Sep 01 '16 at 14:00