title: Use variable inside style tag Angular 2
body: <p>I want to use a animation-delay dynamically inside a <code>ngFor</code> loop. So I am using <code>style="animation-delay:'i's;"</code> where i is the loop variable.
  This is not working.
  My code is like below:</p>
  
  <pre><code>&lt;div class="yourdiv" *ngFor = "let item of gvp.userMessages;let i = index" [attr.data-index]="i"
      style="animation-delay:'i's;"&gt;
                  &lt;div style="text-align:right;margin-right:10px"&gt;
  
                      &lt;ion-icon  name="undo" class="rplymsg msgico"&gt;&lt;/ion-icon&gt;
                      &lt;ion-icon  name="trash" class="delmsg msgico" (click)="deleteMessage()"&gt;&lt;/ion-icon&gt;
  
                  &lt;/div&gt;
                  &lt;div *ngFor = "let msg of item[1]" class="{{msg.substring(0,1) == 'R' ? 'receivedmsg left-top' : 'replymsg right-top' }}"&gt;
                  {{msg.substring(2,msg.length)}}
                  &lt;/div&gt;               
      &lt;/div&gt;
  </code></pre>
  
  <p>Please help.</p>