Created
January 16, 2017 07:51
-
-
Save jiaming0708/b76cdac8842d2f831b8c5df75f63dc05 to your computer and use it in GitHub Desktop.
ngStyle problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- work --> | |
<div class="wave" [style.height.px]="step.DoneItemCount/step.TotalItemCount*150"></div> | |
<!-- not work --> | |
<div class="wave" [ngStyle]="{height:step.DoneItemCount/step.TotalItemCount*150}"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Item } from './item.data'; | |
import { StateType } from './stateType.enum'; | |
export class Step { | |
Id: number; | |
Title: string; | |
ItemList: Item[]; | |
SelectedFlag: boolean; | |
get TotalItemCount() { | |
return this.ItemList.length; | |
} | |
get DoneItemCount() { | |
return this.ItemList.filter(p => p.State === StateType.Done || p.State === StateType.DelayDone).length; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment