Skip to content

TypeAhead not working inside ngFor #356

Closed
@manuelCorredor

Description

@manuelCorredor

When you press enter to select the highlighted suggestion made by the typeAhead , the array that is being iterated by ngfor is reduced to a length of 1. Would be nice if you can help me please.
ng2 version=1.09
Code :

<div  *ngFor="#demandado of notificacionRevMCopy.demandados; #i=index">      
     <div class="input-group"> 
                  <input (blur)="verificarDemandado(i)"
                         [(ngModel)]="demandado.nombre"
                         [typeahead]="demandados"
                         (typeaheadOnSelect)="typeaheadOnSelectDemandado($event,i)"
                         [typeaheadOptionField]="'nombre'"
                         class="form-control">
                         <div [hidden]="!campoFaltanteDemandado[i]" class="alert alert-danger">
                             Este campo es obligatorio.
                         </div>
                      <span class="input-group-btn">
                        <button class="btn btn-default" (click)="removeDemandado(i)" ><img src="images/ico_no_red.png" /></button>
                      </span>
                </div>
                <br>
         </div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions