I have HTML structure like this
<aside class="side" align="left">
<table onclick="reply_click(event)" ng-controller="TableCtrl" >
<tr ng-repeat = "table in tables">
<td><button id = "{{table}}" width = "70">{{table}}</button></td>
</tr>
</table>
</aside>
<article class="tabs">
<section id="erd">
<h2><a href="#erd">ERD</a></h2>
<p>This content appears on tab ERD.</p>
</section>
<section id="col">
<h2><a href="#col">Columns</a></h2>
<h2><a href="#col">Columns</a></h2>
<div id="list" ng-controller="ColCtrl">
<table>
<tr>
<th>Column Name</th>
</tr>
<tr ng-repeat="column in columns">
<td>{{column.name}}</td>
</tr>
</table>
</div>
</section>
<section id="home">
<h2><a href="#home">Home</a></h2>
<p>This content appears on tab Home. lfkdgl;k lkfd;lkg ';lkfg ;lkg 'df;lk ;lk ';lk ';fdlkg ';fdlkg';dflk;ldfkg';lkdlfkdfkglkdf lkjhlsdjhfljdfhlkjdh jh jhkjdhfkjsdhf skjdhf lk h dsfjlkjsdlkfj;dslkfj dskfj;kj sdfkj fkdj;lfkjsd;lkfj sdkfj ;slkj sdfj;lskjf skdj flksjdf ; sdfkj ;sdlkfj dskfj sdkjfhueuu suehu heu he u heu heh ueh ufhu fhe uueh ush uhsudh ue huhuhufheuheu u heiu h euh eh ue </p>
</section>
</article>
I used the suggestions from this SO answer to call a controller AngularJS. How to call controller function from outside of controller component
The controller I and calling is
angular.element(document.getElementById("list")).scope().loadColumns();
It fires correctly. The problems I am calling it from a button in TableCtrl component. After loadColumns() is fired it went to the TableCtrl component to loop which is the wrong place. How can I tell it to go to the correct place ColCtrl area to loop and populate data?
Thanks,