Skip to content
TheChatArchiveThe Chat Archive
gpt-4o-mini-2024-07-18· OpenAIAi2 WildChat-4.8M (AI2)

angular '<li [class]="AISummaryResponse.stories.totalEstimationNotDone > 0 ?…

  1. 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

  2. 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-container is used to encapsulate a block of HTML that conditionally displays based on the total estimation not done.
    • If totalEstimationNotDone is 0, it will display "Effort estimation is done for all stories."
    • If it's greater than 0, it will redirect to a ng-template named notDone.
    • In the notDone template:
      • If totalEstimationNotDone is 1, 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.

    This way, you ensure that the appropriate text is shown based on the number of stories without estimation.