Page 1 of 1

Suggestions and Loading Symbol not loading when created dynamically

Posted: 21 Jul 2023, 15:00
by kinjal.thakkar
Hi,
While trying to create a component dynamically using createComponent API from @angular/core, the suggestions and loading symbol arent loading.

HTML
<p-autoComplete [style]="{'width':'100%'}" [inputStyle]="{'width':'100%'}" [(ngModel)]="selectedAddress" [suggestions]="cSVSuggestionModelOutput.Attributes" (completeMethod)="csvSuggestionHandler($event)" field="{{infos.searchFieldName}}" [minLength]="3" placeholder="{{infos.placeholder}}" (onSelect)="findAddress()" (onKeyUp)="keyPress($event)">
<ng-template let-address pTemplate="item" #itemRender>

<div [innerHTML]="address[infos.searchFieldName] | highlight: selectedAddress"></div>

</ng-template>
</p-autoComplete>

TS
reloadComponent(defaultValue:any){

const someDOMElement = document.querySelector('.host app-address-lookup') as HTMLElement;


this.componentRef = createComponent(AddresslookupComponent,{environmentInjector:this.appRef.injector,hostElement:someDOMElement});

this.appRef.attachView(this.componentRef.hostView);

this.componentRef.changeDetectorRef.detectChanges();

}

Re: Suggestions and Loading Symbol not loading when created dynamically

Posted: 01 Aug 2023, 08:44
by kinjal.thakkar
Hi ! Any one can help in this ?

Re: Suggestions and Loading Symbol not loading when created dynamically

Posted: 05 Aug 2023, 15:02
by Melloware
Wrong forum this is PrimeReact you want PrimeNG.