Angular nested conditions using ng switch

Is it possible for the first condition of the first root to be evaluated with ng-show, ng-if, or ng-switch before the second level state sequence was evaluated with ng-switch

<div ng-if="firstcondition = 'true'" >
   <div ng-switch="secondCondition">
      <div ng-switch-when="0">
         <div ng-include="'firstview.html'"></div>
      </div>
      <div ng-switch-when="2">
         <div ng-include="'secondView.html'"></div>
      </div>
      <div ng-switch-when="3">
         <div ng-include="'thirdView.html'"></div>
      </div>
   </div>
</div>

      

+3


source to share


1 answer


Your point of error is here

<div ng-if="firstcondition = 'true'" >

      

It should be



<div ng-if="firstcondition == 'true'" >

      

You are using a single character =

that is used for assignment.

+1


source







All Articles