Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private loadView(viewType: string): View {
if (viewType.toLowerCase() == ListViewViewType.ItemView.toLowerCase() && typeof this.nativeElement.itemTemplates == "object" ) {
let keyedTemplate = this.nativeElement.itemTemplates.find(t => t.key == "default");
if (keyedTemplate) {
return keyedTemplate.createView()
}
}
let componentClass = this.getComponentForView(viewType);
if (!componentClass) return null;
logger.debug("creating view for " + viewType);
let wrapper = createElement('StackLayout') as NativeViewElementNode
private loadView(viewType: string): View {
if (viewType != AutoCompleteViewType.ItemView)
return null;
let suggestionView = this.nativeView.suggestionView
if (!suggestionView || !suggestionView.__SvelteNativeElement__) return;
let componentClass = (suggestionView.__SvelteNativeElement__ as SuggestionViewElement).itemTemplateComponent;
if (!componentClass) return null;
logger.debug("creating view for " + viewType);
let wrapper = createElement('StackLayout') as NativeViewElementNode