I'm attempting to assign a class to li elements if they contain content. Check out my code:
<li ng-repeat="answer in answers" ng-class="{'textleft': textleft}">
<p class="left" ng-bind="maintext"></p>
<p class="right" ng-bind="optionaltext" ng-model="textleft" ng-init="textleft=true" ng-if="answer.category != null"></p>
</li>
I want to center the text within the li if only one of the p elements is visible. It currently functions when I declare the ng-model textleft before the li ng-class. Does anyone have a solution to achieve this functionality?