Угловые 2 проходные переменные с включением

У меня есть вид с awaken-card компонент отображается в моем client-details составная часть:

<awaken-card
  *ngIf="repo_comments && repo_comments.length > 0"
  title="Weight Loss"
  [subtitle]="weightloss | weightFormat"
  [expandable]="true"
  [isExpanded]="true"
  [list_length]="repo_comments.length"
  [type]="['comment', 'comments']"
  [items]="repo_comments"
>
  <i class="fa fa-scale-bathroom blue fs-80 icon-shadow" card-icon></i>
  <comment *ngFor="let comment of repo_comments" [comment]="comment" card-list></comment>
</awaken-card>

Этот компонент имеет тело, которое может быть занято любым элементом, но в этом случае его comment составная часть.

в awaken-card Компонент у меня есть возможность переключения editMode где я хотел бы иметь возможность удалить comment из списка.

<ion-toolbar class="other-card-part" style="background: #f9f9f9;" *ngIf="expandable">
  <ion-buttons class="align-items-center">
    <span start item-start padding-left style="line-height:32px;">
      {{ list_length }} {{ list_length == 0 ? type[1] : list_length == 1 ? type[0] : type[1] }}
    </span>
    <span>{{ editMode }}</span>

    <button item-end end
      ion-button small clear
      style="float:right;"
      (click)="toggleSection()"
      [disabled]="list_length == 0"
    >
      {{ isExpanded ? '- Collapse' : '+ Expand' }}
    </button>
    <button
      padding-right
      style="line-height: 32px"
      ion-button small clear
      style="float:right;"
      color="danger"
      (click)="toggleEdit()"
    >Edit</button>
  </ion-buttons>
</ion-toolbar>

<div class="card-footer" *ngIf="expandable">

  <div class="expandable" *ngIf="expandable && list_length > 0" [@heroState]="isExpanded ? 'active' : 'inactive'">
    <ion-list class="awaken bordered" no-lines>

      <ng-content select="[card-list]"></ng-content>

    </ion-list>
  </div>
</div>

Проблема в том, что единственный способ пройти editMode от awaken-card к comment чтобы выпустить событие до client-details уровень, а затем перейти обратно к comment составная часть.

Есть ли лучший способ сделать это, чтобы я мог передать его прямо из awaken-card к comment?

0 ответов

Другие вопросы по тегам