angularjs - Cannot reference template element inside directive -


i'm trying create custom directive use in ionic framework. problem during linking phase, i'm not able query inside template.

my template following:

<ion-nav-buttons side="right"> <div class="searchbar">     <div class="searchtxt">         <div class="bgdiv"></div>         <div class="bgtxt">             <input class="searchbox" type="text" />         </div>     </div>     <i class="searchicon icon placeholder-icon" ng-click="callsearch()"></i> </div> </ion-nav-buttons> 

my linking function

link: function(scope, element, attrs){...} 

but when check element value is:

<ion-nav-buttons side="right" class="hide"></ion-nav-buttons> 

how rest of elements? because i'm using directive? how can address this?

when have element, can make queries inside elements usuan jquery syntax:

$(element).find('.searchbar')[0] 

or

$(element).find('.searchbox')[0] 

Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -