<ng-switch on="MyData.Status">
<p ng-switch-when="2">
<p ng-if="MyData.SomeProp == false">
Message 1
</p>
<p ng-if="MyData.SomeProp == true">
Message 2
</p>
</p>
</ng-switch>
To execute the block of code with MyData.SomeProp == false
only when ng-switch-when="2"
, you can use the following pseudo code:
if (MyData.Status == 2){
if (MyData.SomeProp == false){
print message 1
}
else{
print message 2
}
}
You can achieve this using AngularJS by implementing the above logic in your controller or directive.