Hello, in my angular 6 application I would like to focus list composed from
div tag below: I have search box where in usertypes and auto populated div
appears wherein if user selects any list it should focus to the list which
has been selected, I tried to put #data as below but things are not
working, one click of div I have ts code if user selects from the list it
appears using setValue method as given below. the project is big so I can
not put URL nor could do composition. please help if you can

<div class="list-card" *ngFor="let data of listName; let i = index">
<div class="list-item"(click)="displaySelectedValue(data)">
<span class="list-name" #dataw>
{{data?.name}}
<span class="pull-right">
<em class="icon-17"></em><br />
<span>{{data?.portfolioListType}}</span>
</span>
</span>
<div *ngIf="showTillTip(data?.description) else showInstwithoutEllipses">
<span
[ngbTooltip]="showTooltip">{{ getEllipsesInstrument(data?.description) }}</
span>
</div>
<ng-template #showInstwithoutEllipses>
<td>{{data?.description}}</td>
</ng-template>
<ng-template #showTooltip>
<bb-tooltip [data]="data?.description"></bb-tooltip>
</ng-template>
</div>
</div>

SetValue(SelectedList: string) {
this.inputField.nativeElement.value = SelectedList
this.divVisible = false;
if(this.dataw != undefined) {
console.log("1");
console.log(this.dataw)
this.dataw.changes.subscribe(()=>{
if (this.dataw !=undefined) {
console.log("!2")
console.log(this.dataw.last.nativeElement)
this.dataw.last.nativeElement.focus();
}})
}
}

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/CAKVZMjD2EN%3D-VY6G3tgmhQWyf-fZ9uWvGs%2BtU2HCOZM1o%3DjQ5g%40mail.gmail.com.

Reply via email to