SHARE
TWEET

Untitled

a guest Jun 15th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if(x > 1920 && y < 4 && p !== 'expand') {
  2.          // do work
  3.     } else {
  4.          // do work
  5.     }
  6.      
  7. const max_screen_size = 1920;
  8.     const min_device_count = 4;
  9.     const expanded_mode = 'expand';
  10.  
  11.     const valid_screen = screen_size > max_screen_size && device_count < min_device_count;
  12.     const valid_mode = mode !== expanded_mode;
  13.  
  14.     if(valid_screen && valid_mode) {
  15.        // do work
  16.     } else {
  17.        // do work
  18.     }
  19.      
  20. <div *ngIf="user_role === 'admin'>
  21.          Admin features
  22.     </div>
  23.     <div *ngIf="user_role !== 'admin'>
  24.          General features
  25.     </div>
  26.      
  27. <div *ngIf="user_role === 'admin; else general'>
  28.          Admin features
  29.     </div>
  30.     <ng-template #general>
  31.          General features
  32.     </ng-template>
  33.      
  34. <div *ngIf="data.user.permission">
  35.         <span>{{data.user.permission.title}}</span>
  36.         <span>{{data.user.permission.code}}</span>
  37.    </div>
  38.      
  39. <div *ngIf="data.user.permission as perm">
  40.         <span>{{perm.title}}</span>
  41.         <span>{{perm.code}}</span>
  42.    </div>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top