Skip to content

Instantly share code, notes, and snippets.

@jiaming0708
Created January 16, 2017 07:51
Show Gist options
  • Save jiaming0708/b76cdac8842d2f831b8c5df75f63dc05 to your computer and use it in GitHub Desktop.
Save jiaming0708/b76cdac8842d2f831b8c5df75f63dc05 to your computer and use it in GitHub Desktop.
ngStyle problem
<!-- 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>
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