Ngfor not changing the old style value

时间:2017-06-15 09:44:08

标签: angularjs typescript

In my component html creating the month list using ngfor and calling the function(myColDiv) to set the class(attribute) of the div and setting the variable value for width (some calculation).

html

<div  *ngFor="let monthCnt of monthCounts;" >
    <div [attr.class]="myColDiv(monthCnt)">
       <div class="myEventTitleProgress" [style.width]="prjtStartDays+'%'">
         {{prjtStartDays}}
       </div>
    </div>
</div>

ts

 myColDiv(month) {
      this.prjtStartDays = month*10;
      return "col-"+month;
    }

why this.prjtStartDays not binding to old values also , anything wrong on this?

Each div has proper values like 10,20,30,10...120. How to make all the div width as last value (120).

0 个答案:

没有答案