Angular 7 error: ERROR TypeError: jit_nodeValue_5 (...) is not a function

0

I have a simple page with 3 modals, which are opened when clicking buttons to request yes or no to perform actions. In one of them I only have this error, by clicking on the yes button of the confirmation modal, which calls a function. Modals have the same html changing only text and call function (which are very similar too)

I've already run the npm update and checked all modules and are up to date.

Code:

<ng-template #modal let-modal>
                <div class="modal-header">
                  <h4 class="modal-title" id="modal3">Confirmação</h4>
                  <button type="button" class="close" aria-label="Close" (click)="modal.dismiss()">
                    <span aria-hidden="true">&times;</span>
                  </button>
                </div>
                <div class="modal-body">
                  <form>
                    <div class="form-group">
                      Tem certeza que deseja executar essa ação?           
                    </div>
                  </form>
                </div>
                <div class="modal-footer">
                  <div class="row">
                    <div class="col-lg-6">
                      <button class="btn btn-outline-dark" type="button" (click)="delete(3)">Sim</button>
                    </div>
                    <div class="col-lg-6">
                      <button class="btn btn-outline-dark" type="button" (click)="modal.dismiss()">Não</button>
                    </div>
                  </div>
                </div>
              </ng-template>


async delete(id:number) {
    let response = await this.delete(id)
    .toPromise()
    .catch(error => this.error = error);

    console.log(this.error);
  }

delete(id:number) {
    return this.myService.deleteById(id);
  }

Failed to call function, causing error: - ERROR TypeError: jit_nodeValue_5 (...) is not a function

  • CONTEXT ERROR DebugContext_ {view: {...}, nodeIndex: 13, nodeDef: {...}, elDef: {...}, elView:

I have tried to put the same call of the function outside the modal, in a button, and continues the error.

Thank you for your contributions.

    
asked by anonymous 04.01.2019 / 16:15

1 answer

0

It seems that the problem was solved by changing the name of the delete function, for some reason this was the problem (even though it does not have a function with the same name in this file), problem solved.     

04.01.2019 / 16:27