title: Angular 11 how to pass row item from template to observable
body: <p>html:</p>
  <pre><code>    &lt;tr
          *ngFor=&quot;let workflow of auditWorkflows&quot;
          class=&quot;border-bottom&quot;
          [rowClick]=&quot;workflow | auditWorkflowRouteNavigate&quot;
          [rowClickGate]=&quot;startAuditIfNotStarted$&quot;
      &gt;
  </code></pre>
  <p>.ts</p>
  <pre><code>startAuditIfNotStarted$ = new Observable((subscriber) =&gt; {
          if (this.auditInProgress) {
              subscriber.next(true);
              subscriber.complete();
          } else {
  ***//Here i need to get the current row item i.e workflow.id to do some additional logic***
              this.confirmDialog.confirm({
                  header: 'Begin audit',
                  message: 'Are you sure you would like to start the audit?',
                  acceptLabel: 'Yes',
                  rejectLabel: 'No',
                  accept: () =&gt; {
                      this.auditInstanceService.start(this.auditId).subscribe(() =&gt; {
                          this.auditInProgress = true;
                          subscriber.next(true);
                          subscriber.complete();
                      });
                  },
                  reject: () =&gt; {
                      subscriber.next(false);
                      subscriber.complete();
                  }
              });
          }
  });
  </code></pre>
  <p>directive code block:</p>
  <pre><code>@Input('rowClick')
  options: RouterNavigateParams;
  
  @Input('rowClickGate')
      gate$?: Observable&lt;boolean&gt;;
      
      private applyGateThen(callback: () =&gt; void) {
          if (this.gate$) {
              this.gate$.pipe(take(1)).subscribe((allow) =&gt; {
                  if (allow) {
                      callback();
                  }
              });
          } else {
              callback();
          }
      }
  </code></pre>
  <p>Now, in the existing code , i want to pass the 'workflow' item from *ngFor into the observable, so i can do some additional logic. If i used a method as below, the method is called so many times. Is there a better way to get hold of the row item?</p>
  <pre><code>[rowClickGate]=&quot;provideSub(workflow)&quot;
  </code></pre>