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();
}
Suggestions and Loading Symbol not loading when created dynamically
Wrong forum this is PrimeReact you want PrimeNG.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1
-
- Information
-
Who is online
Users browsing this forum: No registered users and 6 guests