Skip to content

Instantly share code, notes, and snippets.

@bipon68
Last active January 21, 2020 13:26
Show Gist options
  • Save bipon68/821317680348aaafc2ff2d253188459b to your computer and use it in GitHub Desktop.
Save bipon68/821317680348aaafc2ff2d253188459b to your computer and use it in GitHub Desktop.
Angular ngStyle and ngClass
[ngStyle]="{'text-align':col.field=='ItemId'?'right':col.field=='AccessionNo'?'right':col.field=='Qty'?'right':col.field=='Rate'?'right':'left'}"
#ngStyle multiple property
[ngStyle]="{'width': col.header=='Waiting Time'?'80px':col.header=='Arrival Time'? '200px':col.header=='Status'?'120px':'', 'text-align': col.header=='Arrival Time'?'right':'left'}"
#ngClass
[ngClass]="expanded ? 'fa fa-fw fa-chevron-circle-down' : 'fa fa-fw fa-chevron-circle-right'"
##
# ternary
class="{{flipPatientImaging === false ? 'flip-active-btn' : 'flip-normal-btn'}}"
let flipItem = (<HTMLElement>document.querySelector('.bottom-flip-content')).offsetHeight;
document.getElementById('common-flip-all-tab').style.height = flipItem + 50 + 'px';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment