Below is my code where i am trying to create a typehead component. But its giving error
cmp.find(...).getElement is not a function
How to resolve this issue.
component -
<aura:component implements="flexipage:availableForAllPageTypes" access="global" controller="AccountController" >
<ltng:require scripts="{!$Resource.rxjs2}" afterScriptsLoaded="{!c.autoComplete}"/>
<ltng:require scripts="/resource/Lgt_InputLookup/js/jquery-2.2.4.min.js,
/resource/Lgt_InputLookup/js/bootstrap.min.js,
/resource/typeahead"
styles="/resource/Lgt_InputLookup/css/bootstrap.min.css" />
<aura:attribute name="accounts" type="Account[]"/>
<form class="slds-form--stacked">
<div class="slds-form-element">
<label class="slds-form-element__label" for="name">Name</label>
<div class="slds-form-element__control">
<ui:inputText aura:id='atcmplbox' class="slds-input" updateOn="keyup"/>
</div>
</div>
<div class="slds-form-element">
<label class="slds-form-element__label" for="email">Email</label>
<div class="slds-form-element__control">
<input id="email" class="slds-input" type="text" />
</div>
</div>
<div class="slds-form-element">
<button class="slds-button slds-button--brand" type="button">Update</button>
</div>
</form>
<datalist id="acctlist">
<aura:iteration items="{!v.accounts}" var="account">
<option value = "{!account.Name}"/>
</aura:iteration>
</datalist>
</aura:component>
Controller -
({
autoComplete : function(cmp, event, helper) {
helper.autoComplete(cmp);
}
})
helper -
({
autoComplete: function(cmp) {
var self = this;
var test = cmp.find('atcmplbox');
console.log(cmp.find('atcmplbox').getElement());
}
})
Render -
({
afterRender : function(cmp,helper){
return this.superAfterRender();
}
})