I have a very simple app which consists of an input form to POST some data, and a table with a list of items that have already been submitted on the same page.
I'm trying to populate this table with the items that have already been added using a $http request upon page load.
Currently my index.html is as follows:
<div id="container">
<div id="form-container" ng-controller="inputFormController">
<form id="form" ng-submit="submit()">
//input fields
</form>
</div>
<hr>
<div id="table-container" ng-controller="blacklistTableController" ng-init="init()">
<table>
//ng-repeat rows
</table>
</div>
</div>
As you can see I am currently preloading the data into the table using ng-init, which works, although I believe this is the incorrect way of doing it after reading the documentation.
I've looked into loading the data into blacklistTableController using a resolve through routeProvider, although from my understanding (please correct me if I'm wrong) this can't be used to inject data into a controller already on the page, plus there will only be a single route for the whole app at / which seems to defeat the point of using routeProvider.