I have an app with AngularJS using Material Design and md.data.table in the latest version of each Framework (respectively 1.6.4, 1.1 .0 and 0.10.x). In the documentation for md.data.table you can verify that there is a callback function when an item in the table is selected. However,whenusingthisfunctioninmyscripts,italwayshappensthatthisfunctionisnevercalledonce.Itisinvokedwhenthetableisloaded,whenIselectanitem(whichwasonlyforONEtime,butittriggers150simultaneouscallswhich,formycode,shouldnothappen),IhavealreadytriedtoworkaroundthisproblemandIdecidedtoaskforhelp.BelowisatestthatIdidwithaconsolelog.
Code
vm.onMainFlowSelected=(flow)=>{console.log('executado');}
PrintScren
ThescreenhasjustloadedandNOTHINGisselected,however
Console
Theywereexecuted80times,onlyonpageload.
Justsoasnottobeindoubt,hereismydirectiveat AngularJS
<tr
md-row md-select="flow"
md-select-id="flow.id"
md-auto-select
md-on-select="onSelectItem(flow)">