1
<div r6-modal-dialog class="r6modal-dialog--medium">

I would like to add if statement in class

I know that I can do it so:

<div r6-modal-dialog ng-show="!data.selectedValue" class="r6modal-dialog--medium">
<div r6-modal-dialog ng-show="data.selectedValue" class="r6modal-dialog--small">

Is it possible to do it in one line?

mbrc
  • 2,817
  • 12
  • 36
  • 62
  • 1
    Have you tried: https://docs.angularjs.org/api/ng/directive/ngClass – PerunSS Aug 12 '16 at 08:36
  • 2
    I thick this link can help you [if else statement in AngularJS templates](http://stackoverflow.com/questions/15810278/if-else-statement-in-angularjs-templates) – shady youssery Aug 12 '16 at 08:42

2 Answers2

3

Try wit ngCLass

<div r6-modal-dialog ng-class="data.selectedValue? 'r6modal-dialog--small' : 'r6modal-dialog--medium'">
senzacionale
  • 19,912
  • 67
  • 198
  • 310
2
<div r6-modal-dialog ng-class="{'r6modal-dialog--small': data.selectedValue, 
                      'r6modal-dialog--medium': !data.selectedValue}">
Vamsi
  • 9,044
  • 6
  • 37
  • 46