angular '<li [class]="AISummaryResponse.stories.totalEstimationNotDone > 0 ?…
- User
angular '<li [class]="AISummaryResponse.stories.totalEstimationNotDone > 0 ? 'expandableLiTag' : ''" [attr.data-toggle]="AISummaryResponse.stories.totalEstimationNotDone > 0 ? 'collapse' : null" data-target="#backlogStoryEffortEstimationCollapseContent" aria-expanded="false" aria-controls="backlogStoryEffortEstimationCollapseContent">Effort Estimation is not done for {{AISummaryResponse.stories.totalEstimationNotDone }} stories.' if 0 Estimation is done for all stories, if 1 estimation is done for 1 story, else stories
- Assistant
You can modify your Angular template to conditionally display the text based on the value of
AISummaryResponse.stories.totalEstimationNotDone. Here's how you can do it:<li [class]="AISummaryResponse.stories.totalEstimationNotDone > 0 ? 'expandableLiTag' : ''" [attr.data-toggle]="AISummaryResponse.stories.totalEstimationNotDone > 0 ? 'collapse' : null" data-target="#backlogStoryEffortEstimationCollapseContent" aria-expanded="false" aria-controls="backlogStoryEffortEstimationCollapseContent"> <ng-container *ngIf="AISummaryResponse.stories.totalEstimationNotDone === 0; else notDone"> Effort estimation is done for all stories. </ng-container> <ng-template #notDone> Effort estimation is {{ AISummaryResponse.stories.totalEstimationNotDone === 1 ? 'done for 1 story' : 'not done for ' + AISummaryResponse.stories.totalEstimationNotDone + ' stories.' }}. </ng-template> </li>Explanation:
- The
ng-containeris used to encapsulate a block of HTML that conditionally displays based on the total estimation not done. - If
totalEstimationNotDoneis0, it will display "Effort estimation is done for all stories." - If it's greater than
0, it will redirect to ang-templatenamednotDone. - In the
notDonetemplate:- If
totalEstimationNotDoneis1, it will display "Effort estimation is done for 1 story." - Otherwise, it will display "Effort estimation is not done for X stories." where X is the value of
totalEstimationNotDone.
- If
This way, you ensure that the appropriate text is shown based on the number of stories without estimation.
- The